added destructor to bgPixmap, to cleanup after itself. That was probably the cause...
authorsasha <sasha>
Wed, 14 Nov 2007 22:25:41 +0000 (22:25 +0000)
committersasha <sasha>
Wed, 14 Nov 2007 22:25:41 +0000 (22:25 +0000)
src/background.C
src/background.h
src/rxvttoolkit.C
src/rxvttoolkit.h

index fb800a8fd2ba4940a544ea7927cd7ad75996d0c1..ac7ffee44c347dfecf6ec0292b11700a7ea7d4ae 100644 (file)
@@ -102,6 +102,15 @@ bgPixmap_t::bgPixmap_t()
   pixmap = None;
 }
 
+bgPixmap_t::~bgPixmap_t()
+{
+#ifdef HAVE_AFTERIMAGE
+  if (original_asim)
+    safe_asimage_destroy (original_asim);
+#endif
+  if (pixmap && target)
+    XFreePixmap (target->dpy, pixmap);
+}
 
 bool
 bgPixmap_t::window_size_sensitive ()
index ede6ab853b7332254aff76e94f312efea846cfd2..59a3913af8100ef220e9849508fb24c52aa048e0 100644 (file)
@@ -16,6 +16,7 @@
 struct  bgPixmap_t {
 
   bgPixmap_t();
+  ~bgPixmap_t();
 
   enum {
     geometrySet     = (1UL<<0),
index a7e42a0658aba69d7cf5e3406da224cc37528443..626c7104a16b43b3b50f31e89d253cdbdf545bec 100644 (file)
@@ -888,3 +888,19 @@ rxvt_color::fade (rxvt_screen *screen, int percent, rxvt_color &result, const rg
   );
 }
 
+#if TRACE_PIXMAPS
+# undef XCreatePixmap
+# undef XFreePixmap
+Pixmap trace_XCreatePixmap (const char *file, int line, Display *dpy, Window r, unsigned int w, unsigned int h, unsigned int d)
+{
+  Pixmap res = XCreatePixmap (dpy, r, w, h, d);
+  fprintf (stderr, "%s:%d: XCreatePixmap (%p,%lX,%u,%u,%u) returned %lX\n", file, line, dpy, r, w, h, d, res);
+  return res;
+}
+
+void trace_XFreePixmap (const char *file, int line, Display *dpy, Pixmap p)
+{
+  fprintf (stderr, "%s:%d: XFreePixmap (%p,%lX)\n", file, line, dpy, p);
+  XFreePixmap (dpy,p);
+}
+#endif
index 536eb484adf63afe7fe8e65c6a7f93eba4aa0863..cec0d379555bb127fb26c2fd65a3ce85725737d7 100644 (file)
@@ -338,5 +338,13 @@ struct rxvt_color {
   void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to = rgba (0, 0, 0));
 };
 
+#if TRACE_PIXMAPS
+Pixmap trace_XCreatePixmap (const char *file, int line, Display *dpy, Window r, unsigned int w, unsigned int h, unsigned int d);
+void trace_XFreePixmap (const char *file, int line, Display *dpy, Pixmap p);
+
+# define XCreatePixmap(dpy,r,w,h,d) trace_XCreatePixmap (__FILE__,__LINE__,dpy,r,w,h,d)
+# define XFreePixmap(dpy,p) trace_XFreePixmap (__FILE__,__LINE__,dpy,p)
+#endif
+
 #endif