diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-04-21 16:42:56 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-10 07:55:36 +0000 |
commit | 37d02d62d8d14fdaa0884f96f7840661413a95c2 (patch) | |
tree | 8e3f3dd9dafd574b99ca686e657d7e73f8f7eef5 /src/qml/qml/qqmlvaluetypewrapper.cpp | |
parent | eb7db5934b453eea2946ed7ae9a188c44467cf23 (diff) |
Make bindings refcounted
Refcounting our bindings greatly simplifies our memory management
of the objects and ensures we safely clean them all up. In addition,
it allows us to remove the m_mePtr and weak reference handling from
QQmlAbstractBinding as we can safely handle this through the same
mechanism.
Change-Id: If23ebc8be276096146952b0008b62018f5d57faf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlvaluetypewrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmlvaluetypewrapper.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index b4d5faa4cf..8918a76c07 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -435,11 +435,10 @@ void QQmlValueTypeWrapper::put(Managed *m, String *name, const Value &value) QQmlBinding *newBinding = new QQmlBinding(value, reference->d()->object, context); newBinding->setTarget(reference->d()->object, cacheData); - QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::DestroyOldBinding); + QQmlPropertyPrivate::setBinding(newBinding); return; } else { - QQmlPropertyPrivate::removeBinding(reference->d()->object, QQmlPropertyData::encodeValueTypePropertyIndex(reference->d()->property, pd->coreIndex), - QQmlPropertyPrivate::DestroyOldBinding); + QQmlPropertyPrivate::removeBinding(reference->d()->object, QQmlPropertyData::encodeValueTypePropertyIndex(reference->d()->property, pd->coreIndex)); } } |