diff options
author | hjk <hjk@theqtcompany.com> | 2015-08-26 10:52:04 +0200 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2015-08-26 10:44:59 +0000 |
commit | fdbee2783a76505a93a23d142f0199a85bb2f35c (patch) | |
tree | cae963e67873754d409ebe8f97314fae019ea00e | |
parent | 474ef4b4efc053606df68837d4905837266b25cd (diff) | |
download | qt-creator-fdbee2783a76505a93a23d142f0199a85bb2f35c.tar.gz |
QmlInspector: Fix crash on engine ramp down
Task-number: QTCREATORBUG-14972
Change-Id: Ia2a508fab872ac4496c2cb3fa932186e8e29278d
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r-- | src/plugins/debugger/qml/qmlinspectoragent.cpp | 4 | ||||
-rw-r--r-- | src/plugins/debugger/qml/qmlinspectoragent.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index 64bd8cb089..70d48f5b86 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -738,6 +738,7 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj, bool append) { qCDebug(qmlInspectorLog) << '(' << obj << parentIname << ')'; + QTC_ASSERT(m_debuggerEngine, return); int objDebugId = obj.debugId(); QByteArray objIname = buildIName(parentIname, objDebugId); @@ -831,7 +832,8 @@ bool QmlInspectorAgent::isConnected() const void QmlInspectorAgent::clearObjectTree() { - m_debuggerEngine->watchHandler()->removeAllData(true); + if (m_debuggerEngine) + m_debuggerEngine->watchHandler()->removeAllData(true); m_objectTreeQueryIds.clear(); m_fetchDataIds.clear(); int old_count = m_debugIdHash.count(); diff --git a/src/plugins/debugger/qml/qmlinspectoragent.h b/src/plugins/debugger/qml/qmlinspectoragent.h index 4719ed2782..979a9d3563 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.h +++ b/src/plugins/debugger/qml/qmlinspectoragent.h @@ -32,6 +32,7 @@ #define QMLINSPECTORAGENT_H #include <QStack> +#include <QPointer> #include <QTimer> #include <qmldebug/baseenginedebugclient.h> @@ -126,7 +127,7 @@ private: void clearObjectTree(); private: - DebuggerEngine *m_debuggerEngine; + QPointer<DebuggerEngine> m_debuggerEngine; QmlDebug::BaseEngineDebugClient *m_engineClient; quint32 m_engineQueryId; |