- the x11 capture wasn't releasing the XImage or the line
authorTony Cook <tony@develop-help.com>
Fri, 12 Jan 2007 10:48:42 +0000 (10:48 +0000)
committerTony Cook <tony@develop-help.com>
Fri, 12 Jan 2007 10:48:42 +0000 (10:48 +0000)
  and color buffers.
- x11_open() incorrectly reset the error handler to junk

Changes
scx11.c

diff --git a/Changes b/Changes
index cef8d55..ea4e90b 100755 (executable)
--- a/Changes
+++ b/Changes
@@ -1,4 +1,7 @@
 0.003
+       - the x11 capture wasn't releasing the XImage or the line
+         and color buffers.
+       - x11_open() incorrectly reset the error handler to junk
        - Makefile.PL was checking /usr/X11R6 for headers instead of 
          /usr/X11R6/include
        - add header directories as -I flags if we find a header in
diff --git a/scx11.c b/scx11.c
index 8e9b6bc..bdea60f 100644 (file)
--- a/scx11.c
+++ b/scx11.c
@@ -80,6 +80,9 @@ imss_x11(unsigned long display_ul, unsigned long window_id) {
     }
     i_plin(result, 0, attr.width, y, line);
   }
+  myfree(line);
+  myfree(colors);
+  XDestroyImage(image);
 
   XSetErrorHandler(old_handler);
   if (own_display)
@@ -94,7 +97,7 @@ imss_x11_open(char const *display_name) {
   Display *display;
 
   i_clear_error();
-  XSetErrorHandler(my_handler);
+  old_handler = XSetErrorHandler(my_handler);
   display = XOpenDisplay(display_name);
   if (!display)
     i_push_errorf(0, "Cannot connect to X server %s", XDisplayName(display_name));