PDA

View Full Version : QPixMap and Memory leak



Krish_ng
7th August 2007, 14:59
I hav an application and wanted to check the memory leak.I am using valgrind for this purpose.When i commented setWindowIcon statement there is decrease in the memory leak.
setWindowIcon(QIcon(":/resources/name.png"));
setLabel->setPixMap(QPixmap(":resources/name.png");
Is there any chance of memory leak if i use statements like this..How to get rid of this..Any ideas

marcel
7th August 2007, 15:18
There is no memory leak.
Valgrind just can't track the deallocation of the QIcon.

You'd be surprised to see how many mem leaks are reported in applications by DevPartner or Purify in Qt(false memory leaks cause by Qt being a library -- they don't seem to handle that well ).

Regards