diff options
author | Semih Yavuz <semih.yavuz@qt.io> | 2022-11-17 14:36:47 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-11-25 19:18:42 +0000 |
commit | 323b973c9e344e65c8b26e11b7d781ccb27bbcd4 (patch) | |
tree | dbcab59291b3fbc4867aa99f60d265282819b40f /src/plugins | |
parent | d493e9952a9f3d22a1c4b9a8d91f0f316a88159b (diff) |
Debugger: Initialize scoped context correctly
Initialize scopedContext with valid qmlContext. Otherwise debugger
crashes on attempt to lookup an object that includes a v4Function
property
Fixes: QTBUG-107607
Change-Id: Iea59bdf9d379a5415abe1767f76f851978b1be3f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit fe32f58008f89b7174e9f41a781e6fba5799c026)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp index dd2a6bfe07..27ad72b214 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp @@ -211,8 +211,8 @@ void ValueLookupJob::run() QScopedPointer<QObject> scopeObject; QV4::ExecutionEngine *engine = collector->engine(); QV4::Scope scope(engine); - QV4::Heap::ExecutionContext *qmlContext = nullptr; - if (engine->qmlEngine() && !engine->qmlContext()) { + QV4::Heap::ExecutionContext *qmlContext = engine->qmlContext(); + if (engine->qmlEngine() && !qmlContext) { scopeObject.reset(new QObject); qmlContext = QV4::QmlContext::create(engine->currentContext(), QQmlContextData::get(engine->qmlEngine()->rootContext()), |