diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-08-06 03:11:21 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-08-06 03:11:21 (GMT) |
commit | d4ebb04b8f0db7821f5059fc31020362f85c7c30 (patch) | |
tree | 67f03f55aa77c14bd1017e00f1c67f7dd914340e /src/declarative/util/qmltransitionmanager.cpp | |
parent | a19afebf6acee64aa4a5c804a87846c91650a474 (diff) | |
download | Qt-d4ebb04b8f0db7821f5059fc31020362f85c7c30.zip Qt-d4ebb04b8f0db7821f5059fc31020362f85c7c30.tar.gz Qt-d4ebb04b8f0db7821f5059fc31020362f85c7c30.tar.bz2 |
Don't leak bindings.
Make sure we clean up bindings for a cancelled state change.
Diffstat (limited to 'src/declarative/util/qmltransitionmanager.cpp')
-rw-r--r-- | src/declarative/util/qmltransitionmanager.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/declarative/util/qmltransitionmanager.cpp b/src/declarative/util/qmltransitionmanager.cpp index b2d9414..be082f8 100644 --- a/src/declarative/util/qmltransitionmanager.cpp +++ b/src/declarative/util/qmltransitionmanager.cpp @@ -239,10 +239,10 @@ void QmlTransitionManager::transition(const QList<Action> &list, } } if (!transition) - d->applyBindings(); //### merge into above foreach? + d->applyBindings(); } - +#include <QDebug> void QmlTransitionManager::cancel() { if (d->transition) { @@ -251,6 +251,18 @@ void QmlTransitionManager::cancel() d->transition = 0; } + for(int i = 0; i < d->bindingsList.count(); ++i) { + Action action = d->bindingsList[i]; + if (action.toBinding && action.deletableToBinding) { + action.property.setBinding(0); + delete action.toBinding; + action.toBinding = 0; + action.deletableToBinding = false; + } else if (action.event) { + //### what do we do here? + } + + } d->bindingsList.clear(); d->completeList.clear(); |