Results 1 to 2 of 2

Thread: why there are memory leaks in Qt?

  1. #1
    Join Date
    Feb 2006

    Unhappy why there are memory leaks in Qt?

    I have created a simple Qt console application in my VisualStudio2005 with only one main file. The content is list bellow:
    #include <afx.h>
    #include <QtCore/QCoreApplication>
    #define new DEBUG_NEW

    int main(int argc, char *argv[])
    QCoreApplication a(argc, argv);
    return a.exec();

    You have noticed that I include the afx.h, and I change the “Use of MFC” option to “Use MFC in a Shared DLL” in project property page also. Then I compile and run the pogram, after the program run, I got A LOT OF memory leak messages from VisualStuido’s output window, like this:

    Detected memory leaks!

    Dumping objects ->

    {246} normal block at 0x003DBE38, 24 bytes long.

    Data: < > 01 00 00 00 02 00 00 00 01 00 00 00 01 00 00 00

    {245} normal block at 0x003DBDF0, 12 bytes long.

    Data: < = ( ( > 80 AA 3D 00 28 FF 12 00 28 FF 12 00


    So, why this happened? or somthing wrong in my program?


  2. #2
    Join Date
    Jan 2006
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4

    Default Re: why there are memory leaks in Qt?

    Nothing wrong with your program.

    It could be a bug Visual Studio, you might want to try alternative memory debuggers such as Purify. Anyway, the output of Visual Studio is not helpful, you might need to build Qt and your program in debug mode to get output that makes sense.

Similar Threads

  1. memory leaks detection in QT
    By kompotFX in forum Qt Programming
    Replies: 15
    Last Post: 28th January 2009, 21:29
  2. Memory leaks..
    By santhoshv84 in forum Qt Programming
    Replies: 2
    Last Post: 28th August 2008, 19:28
  3. Memory leaks in QT apps
    By sar_van81 in forum Qt Programming
    Replies: 7
    Last Post: 19th July 2008, 08:32
  4. Memory leaks when read/write to DOM
    By SailinShoes in forum Qt Programming
    Replies: 6
    Last Post: 20th March 2008, 11:51
  5. memory leaks
    By Fastman in forum Qt Programming
    Replies: 1
    Last Post: 5th March 2008, 08:00


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.