Fix QVariantObject destruction
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 14 Jun 2013 14:08:48 +0000 (16:08 +0200)
committerLars Knoll <lars.knoll@digia.com>
Sat, 15 Jun 2013 13:25:00 +0000 (15:25 +0200)
Make sure to call the VariantObject destructor from its destroy method,
in order to ensure that the ExecutionEngine::ScarceResourceData destructor
we inherit from is also called, which ensures that the refcount in the
QVariant it holds also drops correctly.

Fixes tst_qqmlecmascript::propertyVarCircular

Change-Id: I14df8e2f0d5be6f3049a295a527afa09e19f0ef2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4/qv4variantobject.cpp

index 4841008..f18c5b5 100644 (file)
@@ -94,7 +94,7 @@ void VariantObject::destroy(Managed *that)
     VariantObject *v = static_cast<VariantObject *>(that);
     if (v->isScarce())
         v->node.remove();
-    Object::destroy(that);
+    v->~VariantObject();
 }
 
 bool VariantObject::isEqualTo(Managed *m, Managed *other)