[Gridflow-cvs] [svn] commit: r3671 - /trunk/format/x11.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sat Apr 26 11:52:35 EDT 2008


Author: matju
Date: Sat Apr 26 11:52:34 2008
New Revision: 3671

Log:
fixed leak of X11 GC (Graphics Context, not Garbage Collector!)

Modified:
    trunk/format/x11.c

Modified: trunk/format/x11.c
==============================================================================
--- trunk/format/x11.c (original)
+++ trunk/format/x11.c Sat Apr 26 11:52:34 2008
@@ -87,6 +87,7 @@
 		if (is_owner) XDestroyWindow(display,window);
 		XSync(display,0);
 		dealloc_image();
+		if (imagegc) XFreeGC(display,imagegc);
 		XCloseDisplay(display);
 	}
 	template <class T> void frame_by_type (T bogus);
@@ -101,7 +102,7 @@
 	Window search_window_tree (Window xid, Atom key, const char *value, int level=0);
 	\constructor (...) {
 		transfer=0; use_stripes=false; window=0; ximage=0; image=0; is_owner=true;
-		dim=0; lock_size=false; override_redirect=false; clock=0;
+		dim=0; lock_size=false; override_redirect=false; clock=0; imagegc=0;
 #ifdef HAVE_X11_SHARED_MEMORY
 		shm_info=0;
 #endif
@@ -475,7 +476,7 @@
 
 		if (is_owner) XMapRaised(display, window);
 		imagegc = XCreateGC(display, window, 0, NULL);
-		if (visual->c_class == PseudoColor) prepare_colormap(); 
+		if (visual->c_class == PseudoColor) prepare_colormap();
 	}
 	XSync(display,0);
 }



More information about the Gridflow-cvs mailing list