From kde-devel Sat Aug 28 09:07:41 1999 From: Bo Thorsen Date: Sat, 28 Aug 1999 09:07:41 +0000 To: kde-devel Subject: Re: KDE 1.1.2 khtmlw memory leak patch - please test! X-MARC-Message: https://marc.info/?l=kde-devel&m=93583110914231 On Sat, 28 Aug 1999, Bjarni R. Einarsson wrote: > Hi! > > Regarding http://bugs.kde.org/db/18/1812.html . > > I know I said I didn't know squat about Qt programming. Well I > don't. But the lack of responses here on kfm-devel, some browsing > of the khtmlw source code and "man qdict" inspired me to try > anyway. > > Attached is an untested patch to fix the X/pixmap/cache memory > leak in kdelibs/khtmlw. Yeah, I said untested. I don't have > enough horsepower on my desk to build the KDE libs here at home, > but I will test it when I get to work on Monday. Just compiling > the khtmlw widget to check for syntax errors was painful enough! One small change in the destructor: HTMLCachedImage::~HTMLCachedImage( ) { if (pixmap) delete pixmap; pixmap = 0; } should be HTMLCachedImage::~HTMLCachedImage( ) { delete pixmap; } delete tests for the pointer being 0, and it does not make sense to assign a variable in an object 2 milliseconds away from being deleted :-) Wether your patch works I can't say, since I haven't tested it. -- Bo Thorsen gobo@imada.sdu.dk Lahnsgade 31, st. DK-5000 Odense C Tlf: +45 66 11 83 85