- assigned_to: nobody --> mrudolf
If an engine cannot be run, an error message appears, afterwards, chessx 0.8 crashes.
The crash can probably only be reproduced under Mac OS 10.
The reason for the crash is, that the destructor of Engine is called too early!
Let's take a look at Qt's code, I made two comments for clarification what happens:
bool QProcessPrivate::_q_startupNotification()
{
Q_Q(QProcess);
#if defined QPROCESS_DEBUG
qDebug("QProcessPrivate::startupNotification()");
#endif
if (startupSocketNotifier)
startupSocketNotifier->setEnabled(false);
if (processStarted()) {
q->setProcessState(QProcess::Running);
emit q->started();
return true;
}
q->setProcessState(QProcess::NotRunning);
processError = QProcess::FailedToStart;
emit q->error(processError); // !!!!!!!!!!!!!!!!!!!!!! A receiver of this call calls the destructor of Engine !!!!!!!!!!!!
#ifdef Q_OS_UNIX
// make sure the process manager removes this entry
waitForDeadChild();
findExitCode(); // !!!!!!!!!!!!!!!!!!!! And this line here tries to use the Engine code - a crash follows !!!!!!!!!!!
#endif
cleanup();
return false;
}
So the desctruction of Engine should be left to Qt and not be called manually!!!!!!!