Results 1 to 2 of 2

Thread: QPixMap and Memory leak

  1. #1
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPixMap and Memory leak

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixMap and Memory leak

    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
    Last edited by marcel; 7th August 2007 at 15:14.

Similar Threads

  1. Loading a custom image into a QPixmap
    By KShots in forum Qt Programming
    Replies: 12
    Last Post: 5th August 2006, 00:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.