forked from qt-creator/qt-creator
Debugger: Avoid a soft assert on QmlEngine shutdown
Change-Id: Id26b41e878ed2b8b20099b62ed1c122966165665 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1438,6 +1438,9 @@ void DebuggerEnginePrivate::updateState()
|
|||||||
return;
|
return;
|
||||||
QTC_ASSERT(m_threadLabel, return);
|
QTC_ASSERT(m_threadLabel, return);
|
||||||
|
|
||||||
|
if (m_isDying)
|
||||||
|
return;
|
||||||
|
|
||||||
const DebuggerState state = m_state;
|
const DebuggerState state = m_state;
|
||||||
const bool companionPreventsAction = m_engine->companionPreventsActions();
|
const bool companionPreventsAction = m_engine->companionPreventsActions();
|
||||||
|
|
||||||
|
@@ -478,13 +478,12 @@ void QmlEngine::gotoLocation(const Location &location)
|
|||||||
|
|
||||||
void QmlEngine::closeConnection()
|
void QmlEngine::closeConnection()
|
||||||
{
|
{
|
||||||
if (d->connectionTimer.isActive()) {
|
d->automaticConnect = false;
|
||||||
|
d->retryOnConnectFail = false;
|
||||||
d->connectionTimer.stop();
|
d->connectionTimer.stop();
|
||||||
} else {
|
|
||||||
if (QmlDebugConnection *connection = d->connection())
|
if (QmlDebugConnection *connection = d->connection())
|
||||||
connection->close();
|
connection->close();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void QmlEngine::startProcess()
|
void QmlEngine::startProcess()
|
||||||
{
|
{
|
||||||
@@ -515,8 +514,8 @@ void QmlEngine::shutdownInferior()
|
|||||||
d->runCommand({DISCONNECT});
|
d->runCommand({DISCONNECT});
|
||||||
|
|
||||||
resetLocation();
|
resetLocation();
|
||||||
stopProcess();
|
|
||||||
closeConnection();
|
closeConnection();
|
||||||
|
stopProcess();
|
||||||
|
|
||||||
notifyInferiorShutdownFinished();
|
notifyInferiorShutdownFinished();
|
||||||
}
|
}
|
||||||
@@ -574,6 +573,10 @@ void QmlEngine::continueInferior()
|
|||||||
|
|
||||||
void QmlEngine::interruptInferior()
|
void QmlEngine::interruptInferior()
|
||||||
{
|
{
|
||||||
|
if (isDying()) {
|
||||||
|
notifyInferiorStopOk();
|
||||||
|
return;
|
||||||
|
}
|
||||||
showMessage(INTERRUPT, LogInput);
|
showMessage(INTERRUPT, LogInput);
|
||||||
d->runDirectCommand(INTERRUPT);
|
d->runDirectCommand(INTERRUPT);
|
||||||
showStatusMessage(Tr::tr("Waiting for JavaScript engine to interrupt on next statement."));
|
showStatusMessage(Tr::tr("Waiting for JavaScript engine to interrupt on next statement."));
|
||||||
@@ -948,6 +951,8 @@ Context QmlEngine::languageContext() const
|
|||||||
|
|
||||||
void QmlEngine::disconnected()
|
void QmlEngine::disconnected()
|
||||||
{
|
{
|
||||||
|
if (isDying())
|
||||||
|
return;
|
||||||
showMessage(Tr::tr("QML Debugger disconnected."), StatusBar);
|
showMessage(Tr::tr("QML Debugger disconnected."), StatusBar);
|
||||||
notifyInferiorExited();
|
notifyInferiorExited();
|
||||||
}
|
}
|
||||||
@@ -1122,6 +1127,8 @@ bool QmlEngine::isConnected() const
|
|||||||
|
|
||||||
void QmlEngine::showConnectionStateMessage(const QString &message)
|
void QmlEngine::showConnectionStateMessage(const QString &message)
|
||||||
{
|
{
|
||||||
|
if (isDying())
|
||||||
|
return;
|
||||||
showMessage("QML Debugger: " + message, LogStatus);
|
showMessage("QML Debugger: " + message, LogStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user