forked from qt-creator/qt-creator
QtcProcess: Add an assert about restarting from signal handler
Change-Id: I66ede2c8d726929ceb31a456eb8692e051c1b09e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1128,6 +1128,9 @@ void QtcProcess::setUseCtrlCStub(bool enabled)
|
|||||||
void QtcProcess::start()
|
void QtcProcess::start()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == QProcess::NotRunning, return);
|
QTC_ASSERT(state() == QProcess::NotRunning, return);
|
||||||
|
QTC_ASSERT(!(d->m_process && d->m_guard.isLocked()),
|
||||||
|
qWarning("Restarting the QtcProcess directly from one of its signal handlers will "
|
||||||
|
"lead to crash! Consider calling close() prior to direct restart."));
|
||||||
d->clearForRun();
|
d->clearForRun();
|
||||||
d->m_state = QProcess::Starting;
|
d->m_state = QProcess::Starting;
|
||||||
ProcessInterface *processImpl = nullptr;
|
ProcessInterface *processImpl = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user