[Qt-interest] show a widget without a main window

Malyushytsky, Alex alex at wai.com
Thu Mar 5 21:46:10 CET 2009


>> At that point the operating system will re-claim all memory used by the application. So the leak only exists between closing the widget and exiting the application, which is usually acceptable, especially for demo apps.

According to my knowledge not all operation systems re-claim memory. Windows 95 for example does not.

So memory leak is memory leak :P

Alex





-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Andreas Pakulat
Sent: Thursday, March 05, 2009 12:19 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] show a widget without a main window

On 05.03.09 07:13:03, Knowledge Seeker wrote:
> Is not there a memory leak? there is no
> delete w;
> And also object 'w' is not linked to the parentobject - QApplication, so
> it cant be automatically deleted !!

Yes, but the leak exists only for a very short timeframe usually as its
most of the time the last widget you close and when that happens the
app.exec() call returns and main() is exited. At that point the
operating system will re-claim all memory used by the application. So
the leak only exists between closing the widget and exiting the
application, which is usually acceptable, especially for demo apps.

Of course this is different if that initial widget creates other
top-level widgets and you then close the initial widget. In that case it
should delete itself when its closed, or should be deleted from
somewhere else.

Andreas

--
Chess tonight.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list