Comment 20 for bug 426611

Revision history for this message
In , Osterfeld (osterfeld) wrote :

The problem here is that the Slave is deleted before deref() is called. The scheduler also calls deref() when it receives the slaveDied() signal, and that probably causes the deletion. I would think that the initial ref() prevents that, but apparently it doesn't.
It probably only crashes when somewhere in the signalling some client code does event processing (usually some modal dialog, e.g. error msg). Then the deleteLater triggered in deref() kicks in and causes the slave to be deleted before the deref().

It would be easy to work around the crash by doing

QPointer<QObject> that( this );
...
if ( that ) deref();

But that's only a workaround for the real bug (just broken refcounting? conceptual issue?).