[Qt-interest] Linux core dump with Qt::WA_DeleteOnClose in QMainWindow class
Stephen Collyer
scollyer at netspinner.co.uk
Tue May 5 17:13:40 CEST 2009
2009/5/5 Tim Dewhirst <tim at bugless.co.uk>
> Hello,
>
> Stephen Collyer wrote:
>
>> 2009/5/5 Tim Dewhirst <tim at bugless.co.uk <mailto:tim at bugless.co.uk>>
>>
>> Hi,
>>
>> How is the instance of MDPMainWindow allocated?
>>
>> Tim
>>
>>
>> It's an automatic, in main:
>>
>> #include <QApplication>
>>
>> #include "mdp_main_win.h"
>>
>> int main(int argc, char*argv[])
>> {
>> QApplication app(argc, argv);
>>
>> MDPMainWindow main_win;
>> main_win.show();
>>
>> return app.exec();
>> }
>>
>
> I thought that might be the case... you don't want to try and free that.
> Possible solutions:
>
> * dynamically allocate your main_win; or
> * don't delete on close, just qApp->quit();
>
Right. The scales have just fallen from my eyes. When it says
"DeleteOnClose", it really *means* delete on close .. OK. I only put it in
to take account of my possibly needing multiple main windows at a later
stage anyway, so it can go for now.
Thanks.
--
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090505/81e5fceb/attachment.html
More information about the Qt-interest-old
mailing list