File WindowMaker-refcount.patch of Package WindowMaker

diff -r -N -u WindowMaker-0.92.0-orig/src/switchpanel.c WindowMaker-0.92.0/src/switchpanel.c
--- WindowMaker-0.92.0-orig/src/switchpanel.c	2004-10-30 09:16:04.000000000 +0200
+++ WindowMaker-0.92.0/src/switchpanel.c	2005-09-01 14:28:14.000000000 +0200
@@ -501,6 +501,7 @@
 
     if (!panel->bg) {
         WMFrame *frame = WMCreateFrame(panel->win);
+        WMColor *darkGray = WMDarkGrayColor(scr->wmscreen);
         WMSetFrameRelief(frame, WRSimple);
         WMSetViewExpandsToParent(WMWidgetView(frame), 0, 0, 0, 0);
         
@@ -508,10 +509,11 @@
         WMResizeWidget(panel->label, width, LABEL_HEIGHT);
         WMMoveWidget(panel->label, BORDER_SPACE, BORDER_SPACE+ICON_TILE_SIZE+5);
         WMSetLabelRelief(panel->label, WRSimple);
-        WMSetWidgetBackgroundColor(panel->label, WMDarkGrayColor(scr->wmscreen));
+        WMSetWidgetBackgroundColor(panel->label, darkGray);
         WMSetLabelFont(panel->label, panel->font);
         WMSetLabelTextColor(panel->label, panel->white);
         
+        WMReleaseColor(darkGray);
         height+= 5;
     }
     
@@ -604,6 +606,8 @@
       RReleaseImage(panel->bg);
     if (panel->font)
       WMReleaseFont(panel->font);
+    if (panel->white)
+      WMReleaseColor(panel->white);
     wfree(panel);
 }
 
diff -r -N -u WindowMaker-0.92.0-orig/WINGs/wview.c WindowMaker-0.92.0/WINGs/wview.c
--- WindowMaker-0.92.0-orig/WINGs/wview.c	2004-10-28 04:41:04.000000000 +0200
+++ WindowMaker-0.92.0/WINGs/wview.c	2005-09-01 14:02:33.000000000 +0200
@@ -450,6 +450,9 @@
 
     W_FreeViewXdndPart(view);
 
+    if (view->backColor)
+        WMReleaseColor(view->backColor);
+
     wfree(view);
 }
 

openSUSE Build Service is sponsored by