aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickstate.cpp
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2015-03-23 13:28:49 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-03-25 14:10:22 +0000
commit2e9191f2a9a7dfb1be3f334c36e187255bd93842 (patch)
tree12cbb2aaa8aa5095a7f7b577b9c76a3042c80231 /src/quick/util/qquickstate.cpp
parent3f2eabc8d90c4ee535cb0a2500e033171e203537 (diff)
Fixed a memory-leak when changing property bindings in states.
Bindings that were still stored in the revert-list when the state was destructed were not deleted before. This could lead to considerable memory leaks in big applications. Change-Id: I73250f7d03a42c25ca729c18082125fd8f3c8989 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/quick/util/qquickstate.cpp')
-rw-r--r--src/quick/util/qquickstate.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/util/qquickstate.cpp b/src/quick/util/qquickstate.cpp
index c35ca46aa8..98d7a76c7e 100644
--- a/src/quick/util/qquickstate.cpp
+++ b/src/quick/util/qquickstate.cpp
@@ -157,6 +157,11 @@ QQuickState::~QQuickState()
Q_D(QQuickState);
if (d->group)
d->group->removeState(this);
+
+ foreach (const QQuickSimpleAction &action, d->revertList) {
+ if (action.binding())
+ action.binding()->destroy();
+ }
}
/*!