ProjectExplorer: Fix crashes on shutdown

Ensure that RunControls ramp down asynchronously.

Since RunControls now ramp down asynchronously the plugin can
only report synchronous shut down if no RunControl/OutputPane
was present.

Task-number: QTCREATORBUG-18605
Change-Id: Ib8d1f857f85c74d4f18ecb85db537121a2275668
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2017-07-20 14:43:24 +02:00
parent 35c7360892
commit a54cba428a
4 changed files with 59 additions and 62 deletions

View File

@@ -674,7 +674,6 @@ RunControl::~RunControl()
#ifdef WITH_JOURNALD
JournaldWatcher::instance()->unsubscribe(this);
#endif
disconnect();
delete d;
d = nullptr;
}
@@ -698,7 +697,7 @@ void RunControl::initiateStop()
void RunControl::initiateFinish()
{
d->initiateFinish();
QTimer::singleShot(0, d, &RunControlPrivate::initiateFinish);
}
using WorkerCreators = QHash<Core::Id, RunControl::WorkerCreator>;
@@ -1277,7 +1276,7 @@ void RunControlPrivate::setState(RunControlState newState)
case RunControlState::Finished:
emit q->finished();
debugMessage("All finished. Deleting myself");
deleteLater();
q->deleteLater();
break;
default:
break;