aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-05-09 10:25:20 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-09 05:38:22 +0200
commit54679f48eff344d2dde8d6d4d748b2db497fb29e (patch)
treebe8f19f9888762e23666a787e5a6c20bc609ce99 /src
parentf9eb1d4ed610b6a96a247d9da7316ed8b83a077b (diff)
Fix potential crash and leak in Binding.
With this patch, Binding will always correctly restore the original binding when it becomes inactive (previously it would sometimes restore a deleted binding). In the future we may want to consider changing to retore the most recently set binding instead (it's currently unclear whether either is a better model). Change-Id: Iddde49de0815b2334ec3369963048554d1c8e105 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/util/qquickbind.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/util/qquickbind.cpp b/src/quick/util/qquickbind.cpp
index a3fba06359..e298632edd 100644
--- a/src/quick/util/qquickbind.cpp
+++ b/src/quick/util/qquickbind.cpp
@@ -298,7 +298,7 @@ void QQuickBind::eval()
QQmlAbstractBinding *tmp;
tmp = QQmlPropertyPrivate::setBinding(d->prop, 0);
if (tmp && d->prevBind)
- d->prevBind->destroy();
+ tmp->destroy();
else if (!d->prevBind)
d->prevBind = tmp;
}