[Qt-interest] How to delete the the painter device after the draw is complete
Andre Somers
andre at familiesomers.nl
Mon Dec 14 10:09:11 CET 2009
trinathpujari wrote:
> Hi All,
>
> How to delete a painter instance after draw is completed when
> it is created dynamically.
> This above thing is giving a memory leak in my application.
> My requirement is every time i create a painter and associate
> it with a QImage and after drawing i have to delete the instances of
> QImage and Painter.
> Can anybody tell when to delete the instances of the above
> QImage and Painter respectively.
>
>
So, just create them on the stack in stead of on the heap? That way, as
soon as your function exits, they are deleted automagically for you. If
you insist on using the heap, delete them yourself using "delete".
André
More information about the Qt-interest-old
mailing list