[Interest] crashing Qt through a QObject's dtor

René J.V. Bertin rjvbertin at gmail.com
Tue Jan 6 17:36:02 CET 2015


On Tuesday January 06 2015 16:06:52 Tom Ward wrote:
> Yeah I already use deleteLater() for the QWindow, but still got the event
> coming through weirdly. It only seemed to manifest itself when closing down
> the application (ie this was the last QWindow being deleted), so I figured
> it might be something strange to do with how we close down our event loops.

Hah, so deleteLater() isn't the holy grail either ...

What's possible in your case is that deleteLater() doesn't work from the top event loop because there'd be "no one" left to handle the deferred delete(s) once that toplevel loop exits?

In my case it seems I can't use your event filtering trick, because there is no object I can check against NULL to assess whether I can no longer trust the registered QActions.

In fact, it looks like the menu is taken down before the window, probably by deleting QActions one by one and assuming the QMenu is deconstructed as a result. The troublesome event in turn comes through when the whole menubar is being updated, via [NSMenuItem tag:] which contains the QAction pointer. Clearly the QAction dtor doesn't call a function to remove itself from the information stored "in" the menubar class.

R.



More information about the Interest mailing list