Hello There,

My question is pretty simple:
How is it possible to ensure that an actual QObject is destroyed? Connecting to QObject::destroyed() does not guarantee that the destruction is already done and I could not find any call anywhere to wait until it is done (I was thinking on QCoreApplication:rocessEvents() or QObject::sender() set to 0 but none of those work).
So, how to do that?


(If interested why:
In practice the sender object is a QThread what calls deleteLater() and quit() when it is finished. The slot connected to its destroy() signal - what is emitted by Qt just after the ~ destructor runs - sometimes invoked earlier than the destruction of the object (QObject/QThread or their subclasses) is actually done. It is clear since for example if a QCoreApplication::quit() is called from the slot then it sometimes (sometimes not) results in a "QThread: Destroyed while thread is still running". That also makes it quite difficult to reuse certain pointers.)

Cheers