[Qt-interest] Question about detecting memory leaks!
Ben Hutton
BenHutton at vertex-solutions.co.uk
Wed Dec 15 15:39:22 CET 2010
Any of you guys interested in any contracts?
Regards
Ben
Vertex Solutions........Driving Innovation.
Ben Hutton
Managing Consultant
Vertex Solutions International Ltd.
Tel (UK): 08456 448 441 / (Non UK):(+44) 1442 209 056
Mobile: 07585 976967
b.hutton at vertex-solutions.co.uk <mailto:b.hutton at vertex-solutions.co.uk>
www.vertex-solutions.co.uk <blocked::http://www.vertex-solutions.co.uk/>
(For up to the minute vacancy information, why not sign up for our RSS
feed at www.vertex-solutions.co.uk
<blocked::http://www.vertex-solutions.co.uk/> ).
The E-mail and any attachments hereto are strictly confidential and
intended solely for the addressee. If you are not the intended addressee
please notify the sender by return and delete the message. You must not
disclose, forward, or copy, this E-mail or attachments to any third
party without the prior consent of the sender.Emails are susceptible to
interference. Vertex Solutions Int. Ltd. accepts no responsibility for
information, errors, omissions or corrupt files received as a result of
this email.
Company Information: Name: Vertex Solutions International Ltd.
Registered as a Company in England: 5888058 VAT Number: 892 9219 78.
Company / Registered Address: Vertex Solutions International, Amberside
House | Wood Lane | Hemel Hempstead | HP2 4TP
P Please consider the environment before printing this email.
From: qt-interest-bounces+benhutton=vertex-solutions.co.uk at qt.nokia.com
[mailto:qt-interest-bounces+benhutton=vertex-solutions.co.uk at qt.nokia.co
m] On Behalf Of Jason H
Sent: 15 December 2010 14:43
To: Jack Mack; qt-interest at trolltech.com
Subject: Re: [Qt-interest] Question about detecting memory leaks!
This is not a Qt issue.
You made a new int, which is 1 bytes.
You never deleted it.
Ergo, you have a memory leak.
add:
delete a;
and you will have no more leak.
________________________________
From: Jack Mack <jackmack2000de at yahoo.de>
To: qt-interest at trolltech.com
Sent: Wed, December 15, 2010 8:27:04 AM
Subject: [Qt-interest] Question about detecting memory leaks!
Hi all,
I have a question about detecting memory leaks in my qt based
application.
I'm using Qt 4.7.0 with VS2008.
Maybe this is a simple question and I get a fast answer.
This is my snipped out code of my qt based application:
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:
...
Thread 'Win32 Thread' (0xf68) finished with code 0 (0x0).
BTMMHOOK 15.12.2010 12:19:31 Thread<0460> Hook DLL unloaded
Thread 'Win32 Thread' (0x132c) finished with code 0 (0x0).
Program "[4052] LineView.exe: Systemown" finished with code 0 (0x0).
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:
...
BTMMHOOK 15.12.2010 12:21:16 Thread<0E14> Hook DLL unloaded
Detected memory leaks!
Dumping objects ->
e:\entwicklung\simplemfc\simplemfc\simplemfc.cpp(77) : {565} normal
block at 0x0034B790, 4 bytes long.
Data: < > 01 00 00 00
Object dump complete.
Program "[2160] SimpleMFC.exe: Systemown" finished with code 0 (0x0).
I think that's strange! The compiler warning options are the same.
Yes, I know that all classed inherited by QObject are deleted
automatically and "delete" is not neccessary. But the snipped code above
causes definitly a memory leak.
Can someone explain that to me?
Thanks a lot,
jack
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
______________________________________________________________________
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101215/fff0715e/attachment.html
More information about the Qt-interest-old
mailing list