diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-05-07 16:22:24 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-05-08 10:37:39 +0000 |
commit | 889f717fc57ea9881ca250b8230742633c1ed5a2 (patch) | |
tree | 5268874c85f5bbe6bce9cf161b4a74925a7e4a72 /src/quick/items/qquickitem.cpp | |
parent | ed38067e63cebfe8973992d37852436d305348bd (diff) |
Fix memory corruption when sharing QObjects between different QML engines
When marking the JS wrappers for QObject manually, we cannot use
ddata->jsWrapper directly but we must respect the case where the same
object is exposed to different engines and then we must mark the wrapper
that belongs to the engine that is currently collecting garbage.
Change-Id: If82883c762ccaf3431e7074243ff2ff703234d66
Task-number: QTBUG-44895
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Jan Kundrát <jkt@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 07d7636abf..3d0f550d14 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -6740,9 +6740,7 @@ void QQuickItemPrivate::setHasCursorInChild(bool hasCursor) void QQuickItemPrivate::markObjects(QV4::ExecutionEngine *e) { Q_Q(QQuickItem); - QQmlData *ddata = QQmlData::get(q); - if (ddata) - ddata->jsWrapper.markOnce(e); + QV4::QObjectWrapper::markWrapper(q, e); foreach (QQuickItem *child, childItems) QQuickItemPrivate::get(child)->markObjects(e); |