From c0442b1c5961cc36adfaf66c3c62c62485118a2a Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 30 Nov 2002 03:00:34 +0000 Subject: [PATCH] - WMGetTextDefaultColor() won't retain the returned color anymore, and you shouldn't release it. It is just a reference to the internal WMText color. This should make all the functions returning colors from widgets behave consistently --- WINGs/ChangeLog | 2 ++ WINGs/wcolorpanel.c | 2 +- WINGs/widgets.c | 1 - WINGs/wtext.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index 283578b5..7955e2d7 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -47,6 +47,8 @@ Changes since wmaker 0.80.1: - Fixed a memory leak in wfontpanel.c - Added a check that only %d is used in a font specification in WMGLOBAL and at most once for each font in a fontset (eliminates a possible security exploit) +- Fixed WMGetTextDefaultColor() not to retain the returned color. It returns + only a reference to the internal color, which you shouldn't release Changes since wmaker 0.80.0: diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c index 97712dcc..09380246 100644 --- a/WINGs/wcolorpanel.c +++ b/WINGs/wcolorpanel.c @@ -1401,7 +1401,7 @@ WMGetColorPanelColor(WMColorPanel *panel) return WMGetColorWellColor(panel->colorWell); } - + void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color) { diff --git a/WINGs/widgets.c b/WINGs/widgets.c index d5ee4267..c073b442 100644 --- a/WINGs/widgets.c +++ b/WINGs/widgets.c @@ -1070,7 +1070,6 @@ WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color) WMColor* WMGetWidgetBackgroundColor(WMWidget *w) { - // should retain? return W_VIEW(w)->backColor; } diff --git a/WINGs/wtext.c b/WINGs/wtext.c index 2edd631a..9cbc7e7a 100644 --- a/WINGs/wtext.c +++ b/WINGs/wtext.c @@ -3948,7 +3948,7 @@ WMSetTextDefaultColor(WMText *tPtr, WMColor *color) WMColor* WMGetTextDefaultColor(WMText *tPtr) { - return WMRetainColor(tPtr->dColor); + return tPtr->dColor; } -- 2.11.4.GIT