Files
qt-creator/src/plugins/debugger/qml/qmlinspectoragent.cpp
Ulf Hermann 2808f633ec Debugger: Further robustify QmlInspectorAgent
When (re-)querying the root contexts, make sure we clear the old queries
first. One of the QML engines in the target may have created an object,
causing the contexts to be re-queried while queries for other engines
are still running. This would cause mismatches between the m_engines and
m_rootContextQueryIds arrays. In turn, in onResult() we would access an
invalid index in the m_engines array. Furthermore, make the assert that
guards against such an invalid access a QTC_GUARD and log the pending
queries before they are cleared.

When the target replies to the now-invalid root context queries we will
end up in the default branch of onResult,
m_qmlEngine->expressionEvaluated(), and that one silently ignores
unknown query IDs.

Task-number: QTCREATORBUG-22654
Change-Id: I1fe4751ea3592eb26c494696bea3d84fa3e62617
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-12-02 11:09:35 +00:00

28 KiB