diff --git a/ChangeLog b/ChangeLog index c0a0f3bb..a859107d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,11 @@ Changes since version 0.92.0: on 64bit platforms (Max Loparyev ) - fixed issue with icon colors on big endian platforms (Max Loparyev ) +- release colors to avoid issues with the reference count overflowing a + small integer and causing unexpected color releases that can crash + Window Maker (Martin Frydl ) +- fixed a small memory leak in WINGs/wview.c caused by not releasing the + background color of a view (Martin Frydl ) Changes since version 0.91.0: diff --git a/WINGs/wview.c b/WINGs/wview.c index c1ec136c..be840a9f 100644 --- a/WINGs/wview.c +++ b/WINGs/wview.c @@ -450,6 +450,9 @@ destroyView(W_View *view) W_FreeViewXdndPart(view); + if (view->backColor) + WMReleaseColor(view->backColor); + wfree(view); } diff --git a/src/switchpanel.c b/src/switchpanel.c index 51298ce4..594c141d 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -501,6 +501,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace) 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 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace) 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 @@ void wSwitchPanelDestroy(WSwitchPanel *panel) RReleaseImage(panel->bg); if (panel->font) WMReleaseFont(panel->font); + if (panel->white) + WMReleaseColor(panel->white); wfree(panel); }