[Qt-interest] Question about detecting memory leaks!
Scott Aron Bloom
Scott.Bloom at onshorecs.com
Wed Dec 15 17:25:30 CET 2010
VS has had SIMPLE memory leak detection at least since VC++ 5.0
You can set check points for memory leak detection throughout the code.
MFC sets one at the start and end of the MFC main.
Scott
-----Original Message-----
From: qt-interest-bounces+scott.bloom=onshorecs.com at qt.nokia.com
[mailto:qt-interest-bounces+scott.bloom=onshorecs.com at qt.nokia.com] On
Behalf Of Oliver.Knoll at comit.ch
Sent: Wednesday, December 15, 2010 7:17 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Question about detecting memory leaks!
On 2010-12-15 Jason Jason H wrote:
> ...
> int* a = new int;
> *a = 1;
> When I start the app in debug-mode within VS2008 and finish the app
> correctly by clicking the windows system menu then the output window
> of VS2008 shows only some text like:
[...]
Maybe I am missing something here, but unless you run your application
in some special "memory leak detection debugger" (something like
valgrind on Linux) you *won't* get any hints whether your application
leaks memory! So the fact that you *don't* get the "Detected memory
leaks!" message (where does that come from anyway?) is what I would
expect.
> When I use the snipped code above in a simple MFC application and run
> it in debug-mode and close it then the following text is showed by
> output window of VS2008:
Now it could be that VS2008 has some simple memory leak detection (the
last version I used was VS2005, and I would not know of such a memory
leak detection functionality - then again I was only using the Express
version anyway. The fact that you are able to compile MFC project tells
me that you are using at least the professional VS version)
functionality which you enabled when creating an MFC project. So if
there was such a compiler switch, you have to search through all project
options and compare those between your MFC and Qt project!
On the other hand it could also be that the "MFC runtime/support
libraries" do have some support for detecting memory leaks (honestly, I
have no clue - I always tried to avoid MFC like the pest ;)
In any case, memory leak detection doesn't normally come "out of the
box". You have to enable it "somewhere", but for sure Qt would not
prevent leaks from being detected.
Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list