summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-12-17 22:19:01 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-12-17 22:36:09 (GMT)
commit1b183c42b5ce74797f12a155c6675e195fe96352 (patch)
tree9e733189d2b0e0ef2b8c7e5dbfb396adfded9678
parent4cc135c24f7bc6463963f338f9d696d576b50cf0 (diff)
downloadQt-1b183c42b5ce74797f12a155c6675e195fe96352.zip
Qt-1b183c42b5ce74797f12a155c6675e195fe96352.tar.gz
Qt-1b183c42b5ce74797f12a155c6675e195fe96352.tar.bz2
Use destroy() to destroy binding.
-rw-r--r--src/declarative/qml/qmlobjectscriptclass.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp
index 30d4422..4488ba1 100644
--- a/src/declarative/qml/qmlobjectscriptclass.cpp
+++ b/src/declarative/qml/qmlobjectscriptclass.cpp
@@ -302,7 +302,9 @@ void QmlObjectScriptClass::setProperty(QObject *obj,
// ### Can well known types be optimized?
QVariant v = QmlScriptClass::toVariant(engine, value);
- delete QmlMetaPropertyPrivate::setBinding(obj, *lastData, 0);
+ QmlAbstractBinding *delBinding = QmlMetaPropertyPrivate::setBinding(obj, *lastData, 0);
+ if (delBinding)
+ delBinding->destroy();
QmlMetaPropertyPrivate::write(obj, *lastData, v, evalContext);
}