On Thursday 28 May 2009, Casper Clemence wrote:
> hmmm... there must be a design pattern that achieves this elegantly
> with no extra overhead... maybe

Pixmap bg = XCreatePixmap(display, clientWinId(), width(), height(), d-
>attr.depth);
XPixmapJanitor janitor(bg);


XPixmapJanitor would do the necessary clean up in its dtor. whenever the 
method returns, janitor will fall out of scope, it's dtor will get run, the 
pixap will be freed.

common pattern.

-- 
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 Qt Software

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to