Commit fdbee278 authored by hjk's avatar hjk

QmlInspector: Fix crash on engine ramp down

Task-number: QTCREATORBUG-14972
Change-Id: Ia2a508fab872ac4496c2cb3fa932186e8e29278d
Reviewed-by: default avatarUlf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 474ef4b4
...@@ -738,6 +738,7 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj, ...@@ -738,6 +738,7 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
bool append) bool append)
{ {
qCDebug(qmlInspectorLog) << '(' << obj << parentIname << ')'; qCDebug(qmlInspectorLog) << '(' << obj << parentIname << ')';
QTC_ASSERT(m_debuggerEngine, return);
int objDebugId = obj.debugId(); int objDebugId = obj.debugId();
QByteArray objIname = buildIName(parentIname, objDebugId); QByteArray objIname = buildIName(parentIname, objDebugId);
...@@ -831,6 +832,7 @@ bool QmlInspectorAgent::isConnected() const ...@@ -831,6 +832,7 @@ bool QmlInspectorAgent::isConnected() const
void QmlInspectorAgent::clearObjectTree() void QmlInspectorAgent::clearObjectTree()
{ {
if (m_debuggerEngine)
m_debuggerEngine->watchHandler()->removeAllData(true); m_debuggerEngine->watchHandler()->removeAllData(true);
m_objectTreeQueryIds.clear(); m_objectTreeQueryIds.clear();
m_fetchDataIds.clear(); m_fetchDataIds.clear();
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define QMLINSPECTORAGENT_H #define QMLINSPECTORAGENT_H
#include <QStack> #include <QStack>
#include <QPointer>
#include <QTimer> #include <QTimer>
#include <qmldebug/baseenginedebugclient.h> #include <qmldebug/baseenginedebugclient.h>
...@@ -126,7 +127,7 @@ private: ...@@ -126,7 +127,7 @@ private:
void clearObjectTree(); void clearObjectTree();
private: private:
DebuggerEngine *m_debuggerEngine; QPointer<DebuggerEngine> m_debuggerEngine;
QmlDebug::BaseEngineDebugClient *m_engineClient; QmlDebug::BaseEngineDebugClient *m_engineClient;
quint32 m_engineQueryId; quint32 m_engineQueryId;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment