Notify QQJSE::DW of expression deletion during dtor
authorChris Adams <christopher.adams@nokia.com>
Mon, 19 Mar 2012 02:19:53 +0000 (12:19 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 19 Mar 2012 09:50:22 +0000 (10:50 +0100)
QQmlJavaScriptExpression::DeleteWatcher's wasDeleted() function simply
checks to see if the pointer to the expression being watched is null.
This commit ensures that the DeleteWatcher's expression pointer is
set to null during QQJSE::dtor().

Change-Id: I566737bf30b4466ba96d771d9846fc3dd860cd2f
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>

src/qml/qml/qqmljavascriptexpression.cpp

index 560e0f1..aad6a04 100644 (file)
@@ -69,6 +69,8 @@ QQmlJavaScriptExpression::QQmlJavaScriptExpression(VTable *v)
 QQmlJavaScriptExpression::~QQmlJavaScriptExpression()
 {
     clearGuards();
+    if (m_scopeObject.isT2()) // notify DeleteWatcher of our deletion.
+        m_scopeObject.asT2()->_s = 0;
 }
 
 void QQmlJavaScriptExpression::setNotifyOnValueChanged(bool v)