aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-04 11:35:02 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-04 14:45:30 +0100
commitc6da58a295235c89ee2a5847b15cb0b1dc66b2f4 (patch)
tree069e86a0806921f88b4c5ed2f2e00a3e5ba4a379 /src/qml/types
parent33d5e6996f5ae4131c2233c4da5500e4ebda99ea (diff)
Fix occasional crashes in canvas getImageData and other places
In some places we allocate custom array objects and in the constructor we call setArrayType, which will allocate the array's data through the GC. In all of these cases we need to make sure that the array object itself is protected from garbage collection, because while in the constructor it may not be yet in the scope the callee has usually set up. Change-Id: I96b7af4ae00fd809067e12bacd6563984c5e9240 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 3bf83a1f66..5dbccefbde 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -3198,6 +3198,9 @@ public:
: Object(engine)
{
setVTable(staticVTable());
+ QV4::Scope scope(engine);
+ QV4::ScopedObject protectThis(scope, this);
+ Q_UNUSED(protectThis);
setArrayType(QV4::ArrayData::Custom);
}
virtual ~QQmlDelegateModelGroupChangeArray() {}