Fix memory corruption when sharing QObjects between different QML engines
authorSimon Hausmann <simon.hausmann@theqtcompany.com>
Thu, 7 May 2015 14:22:24 +0000 (16:22 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Fri, 8 May 2015 10:37:39 +0000 (10:37 +0000)
commit889f717fc57ea9881ca250b8230742633c1ed5a2
tree5268874c85f5bbe6bce9cf161b4a74925a7e4a72
parented38067e63cebfe8973992d37852436d305348bd
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>
src/qml/jsruntime/qv4qobjectwrapper.cpp
src/qml/jsruntime/qv4qobjectwrapper_p.h
src/qml/qml/qqmlvmemetaobject.cpp
src/quick/items/qquickitem.cpp