From 503c1e8864f0cd8ab9318ef830054b380e307c9c Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 7 Jan 2000 22:08:35 +0000 Subject: [PATCH] Fixed big memory leak in color panel code (patch from Pascal). --- WINGs/ChangeLog | 1 + WINGs/Makefile.in | 6 +++--- WINGs/Resources/Makefile.in | 4 ++-- WINGs/wcolorpanel.c | 11 ++++------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index a5c94c5b..85546daf 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -37,6 +37,7 @@ changes since wmaker 0.61.1: - new wsyserrorwithcode(int error, const char* fmt, ...), similar to wsyserror(), but printing the message for the specified error code. - added 3 new classes: WMData, WMHost and WMConnection +- fixed a big memory leak in the color panel code (from Pascal Hofstee). changes since wmaker 0.61.0: ............................ diff --git a/WINGs/Makefile.in b/WINGs/Makefile.in index 115faf15..1c874fd5 100644 --- a/WINGs/Makefile.in +++ b/WINGs/Makefile.in @@ -218,7 +218,7 @@ DIST_COMMON = README ChangeLog Makefile.am Makefile.in TODO DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best SOURCES = $(libWINGs_a_SOURCES) $(libWUtil_a_SOURCES) $(wtest_SOURCES) $(wmquery_SOURCES) $(wmfile_SOURCES) $(fontl_SOURCES) $(testmywidget_SOURCES) $(testcolorpanel_SOURCES) $(connect_SOURCES) OBJECTS = $(libWINGs_a_OBJECTS) $(libWUtil_a_OBJECTS) $(wtest_OBJECTS) $(wmquery_OBJECTS) $(wmfile_OBJECTS) $(fontl_OBJECTS) $(testmywidget_OBJECTS) $(testcolorpanel_OBJECTS) $(connect_OBJECTS) @@ -227,7 +227,7 @@ all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .lo .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu WINGs/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WINGs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ @@ -482,7 +482,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/WINGs/Resources/Makefile.in b/WINGs/Resources/Makefile.in index a47c9211..d3a32728 100644 --- a/WINGs/Resources/Makefile.in +++ b/WINGs/Resources/Makefile.in @@ -108,7 +108,7 @@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -150,7 +150,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c index 5afcb929..49e212fb 100644 --- a/WINGs/wcolorpanel.c +++ b/WINGs/wcolorpanel.c @@ -18,8 +18,8 @@ /* TODO: * - Look at further optimization of colorWheel matrix calculation. * It appears to be rather symmetric in angles of 60 degrees, - * while it is optimized in angles of 120 degrees. - * - Custom color-lists and custom colors in custom colo-lists. + * while it is optimized in angles of 90 degrees. + * - Custom color-lists and custom colors in custom color-lists. * - Stored colors * - Resizing */ @@ -2196,10 +2196,9 @@ wheelRender(W_ColorPanel *panel) if (panel->wheelImg) XFreePixmap(scr->display, panel->wheelImg); - panel->wheelImg = XCreatePixmap(scr->display, W_DRAWABLE(scr), - colorWheelSize+4, colorWheelSize+4, scr->depth); RConvertImage(scr->rcontext, image, &panel->wheelImg); - + RDestroyImage(image); + /* Check if backimage exists. If it doesn't, allocate and fill it */ if (!panel->selectionBackImg) { panel->selectionBackImg = XCreatePixmap(scr->display, @@ -2208,8 +2207,6 @@ wheelRender(W_ColorPanel *panel) scr->copyGC, panel->colx -2, panel->coly -2, 4, 4, 0, 0); /* -2 is hot spot correction */ } - - RDestroyImage(image); } -- 2.11.4.GIT