From dd4d3e1ce0adba26396c5ab4e77c728e2159ff30 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 16 Feb 2010 13:12:22 +1000 Subject: Don't delete binding directly Bindings should be destroyed by calling their destroy() method, not by deleting them. --- src/declarative/qml/qmlmetaproperty.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index f23a50a..d63261c 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -754,8 +754,10 @@ bool QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value, QmlMetaProperty::WriteFlags flags) { // Remove any existing bindings on this property - if (!(flags & QmlMetaProperty::DontRemoveBinding)) - delete q->setBinding(0); + if (!(flags & QmlMetaProperty::DontRemoveBinding)) { + QmlAbstractBinding *binding = q->setBinding(0); + if (binding) binding->destroy(); + } bool rv = false; uint type = q->type(); -- cgit v0.12