[Commit] libic/src icimage.c,1.5,1.6 icimage.h,1.6,1.7

Carl Worth commit@keithp.com
Sat, 26 Apr 2003 09:57:57 -0700


Committed by: cworth

Update of /local/src/CVS/libic/src
In directory home.keithp.com:/tmp/cvs-serv27454/src

Modified Files:
	icimage.c icimage.h 
Log Message:
Fixed memory leak

Index: icimage.c
===================================================================
RCS file: /local/src/CVS/libic/src/icimage.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- icimage.c	17 Apr 2003 15:48:22 -0000	1.5
+++ icimage.c	26 Apr 2003 16:57:54 -0000	1.6
@@ -111,7 +111,8 @@
     image->subWindowMode = ClipByChildren;
     image->polyEdge = PolyEdgeSharp;
     image->polyMode = PolyModePrecise;
-    image->freeCompClip = FALSE;
+    /* XXX: In the server this was FALSE. Why? */
+    image->freeCompClip = TRUE;
     image->clientClipType = CT_NONE;
     image->componentAlpha = FALSE;
 
@@ -193,6 +194,11 @@
 {
     if (image->freeCompClip)
 	PixRegionDestroy (image->pCompositeClip);
+
+    if (image->owns_pixels)
+	IcPixelsDestroy (image->pixels);
+
+    free (image);
 }
 
 void

Index: icimage.h
===================================================================
RCS file: /local/src/CVS/libic/src/icimage.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- icimage.h	17 Apr 2003 15:48:22 -0000	1.6
+++ icimage.h	26 Apr 2003 16:57:54 -0000	1.7
@@ -119,6 +119,7 @@
     unsigned int    subWindowMode : 1;
     unsigned int    polyEdge : 1;
     unsigned int    polyMode : 1;
+    /* XXX: Do we need this field */
     unsigned int    freeCompClip : 1;
     unsigned int    clientClipType : 2;
     unsigned int    componentAlpha : 1;