--- rxvt-unicode/src/main.C 2012/08/29 09:43:42 1.383 +++ rxvt-unicode/src/main.C 2014/10/06 11:11:19 1.391 @@ -17,7 +17,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -170,7 +170,7 @@ #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) slip_wheel_ev.set (this); #endif -#if ENABLE_TRANSPARENCY || ENABLE_PERL +#if BG_IMAGE_FROM_ROOT || ENABLE_PERL rootwin_ev.set (this), #endif scrollbar_ev.set (this), @@ -228,6 +228,10 @@ bg_destroy (); #endif +#if HAVE_IMG + delete bg_img; +#endif + if (display) { selection_clear (); @@ -237,9 +241,12 @@ im_destroy (); #endif scrollBar.destroy (); - if (gc) XFreeGC (dpy, gc); + + if (gc) + XFreeGC (dpy, gc); delete drawable; + // destroy all windows if (parent) XDestroyWindow (dpy, parent); @@ -272,6 +279,11 @@ delete selection_req; + if (memcmp (env, envv->begin (), envv->size () * sizeof (char *))) + rxvt_warn ("env has been modified, probably as a result of a lib calling setenv.\n"); + + delete env; + delete envv; delete argv; @@ -313,7 +325,7 @@ im_ev.stop (display); #endif scrollbar_ev.stop (display); -#if ENABLE_TRANSPARENCY || ENABLE_PERL +#if BG_IMAGE_FROM_ROOT || ENABLE_PERL rootwin_ev.stop (display); #endif termwin_ev.stop (display); @@ -1365,9 +1377,9 @@ char **s; XIMStyles *xim_styles; - set_environ (envv); + set_environ (env); - if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) + if (!((p = XSetLocaleModifiers (modifiers)) && *p)) return false; input_method = display->get_xim (locale, modifiers); @@ -1685,11 +1697,6 @@ if (update_background_ev.is_active ()) return; - bg_invalidate (); - - if (!mapped) - return; - ev_tstamp to_wait = 0.5 - (ev::now () - bg_valid_since); if (to_wait <= 0.)