On Mon, Nov 5, 2018 at 11:02 PM Elvis Stansvik <elvst...@gmail.com> wrote:

> But seems to me it would be a slippery slope to accept more
> exceptions.


You say exception, but I say expected behavior, which is actually the crux
of the disagreement.


> What's next, will I have to implement the destruction
> myself in my own widgets? :)
>

Yes, in the general case you actually have to if your dependent objects are
attached to a QObject holding an application-global state. Which is exactly
what Q*Application is - a QObject that has/is a global state.

On Mon, Nov 5, 2018 at 11:50 PM Uwe Rathmann <uwe.rathm...@tigertal.de>
wrote:

> The title of the bug report is about QCoreApplication, while the demo
> code is a QApplication - so I'm not 100% sure if I completely understood
> the discussion.
>

I'm at fault for not attaching the stack trace, but I'll try to explain.
Indeed the example code is for QApplication, the problem however manifests
whenever the destruction of said application object goes through. The
segfault happens because QCoreApplication sets its static member - the
global instance of the application object - to null before the children are
cleaned up by the QObject destructor. This means that objects parented to
the application are destroyed after there's Q*Application object no more.

But at least for QApplication I would consider having children being
> common practice and actually Qt does this too:

[snippet]
>

Interesting point, I haven't thought about it.
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to