[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: [Panel-devel] Problem with caching applet backgrounds
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2007-07-29 15:52:58
Message-ID: 200707290952.58578.aseigo () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Sunday 29 July 2007, Thomas Georgiou wrote:
> On Sunday 29 July 2007 01:02:03 am Aaron J. Seigo wrote:
> > * there's no need to new() pixmaps. it leads to memory leaks, such as how
> > you're leaking backgroundPixmap.
>
> Wouldn't the pixmap be deleted after the function returns though?

no, you have to explicitly delete memory allocated by new.

> And should i store it as a pointer or by value in the d-pointer?

assuming you are referring to cachedContents[1], you may as well do it pointer 
there and just make sure to delete it in the dtor as you did.

the backgroundPixmap variable doesn't need to be stored outside of 
paintBackground in any case.


[1] which is a slightly confusing name given that elsewhere in the 
code "contents" refers to what the applet subclass paints in paintInterface 
and that we aren't actually caching those contents at all, but the background

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech

[Attachment #5 (application/pgp-signature)]

_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic