diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-04-27 09:15:11 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-04 05:51:29 +0200 |
commit | 186abc1e085e4fae7631e329f44e68a810bca38b (patch) | |
tree | ab4ca7211a2a9f788f8790e52579396762ad4213 /src/qml/qml/qqmlbinding.cpp | |
parent | 9ae289f259f80458caf7c788ee07357db7e1257a (diff) |
Ensure binding target has not been deleted
Prevent the evaluation of bindings if the target has been deleted.
Also, mark an item as queued for deletion at the beginning of the
destructor call chain, so that bindings triggered by the operation
of the destructor itself are not evaluated (after the context is
destructed, if necessary).
Task-number: QTBUG-25516
Change-Id: I587ef7923eb749eb7980156ad73822c1fb7c1ff3
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index d2a02dc712..45c22734bc 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -186,6 +186,10 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) if (!enabledFlag() || !context() || !context()->isValid()) return; + // Check that the target has not been deleted + if (QQmlData::wasDeleted(object())) + return; + QQmlTrace trace("General Binding Update"); trace.addDetail("URL", m_url); trace.addDetail("Line", m_lineNumber); |