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

Knowledge Seeker knowledgeseeker78 at gmail.com
Sun Mar 8 08:49:39 CET 2009


"At that point the operating system will re-claim all memory used by the 
application. "
 I dont agree to it, 'heap' if corrupted by user-application, the 
behavior of o/s is undefined to reclaim it back.


Andreas Pakulat wrote:
> 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
>
>   




More information about the Qt-interest-old mailing list