[Development] Allowing event delivery prior to and after QCoreApplication

Thiago Macieira thiago.macieira at intel.com
Wed Jan 14 03:05:17 CET 2015


On Wednesday 14 January 2015 02:17:31 Olivier Goffart wrote:
> > Finally, note what happens if there's a thread trying to deliver events
> > *while* QCoreApplication is being shut down: notifyInternal() is probably
> > dereferencing a dangling pointer.
> 
> Good point.
> But one might argue that thread should be finished before the
> QCoreApplication is destroyed.

Yeah, that sounds like the solution, but just look at both attempts to cause 
QProcessManager's thread to exit:

https://codereview.qt-project.org/60586
https://codereview.qt-project.org/102526

For QtDBus, I could hook to QCoreApplication's destruction, close the 
connections, activate the pending replies with a Disconnected error, and stop 
the thread. I'd just rather not do it, if it weren't required.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list