summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativestate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/util/qdeclarativestate.cpp')
-rw-r--r--src/declarative/util/qdeclarativestate.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 9f56ccb02e..ee3d06b4db 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -173,6 +173,18 @@ QDeclarativeState::~QDeclarativeState()
Q_D(QDeclarativeState);
if (d->group)
d->group->removeState(this);
+
+ /*
+ destroying an active state does not return us to the
+ base state, so we need to clean up our revert list to
+ prevent leaks. In the future we may want to redconsider
+ this overall architecture.
+ */
+ for (int i = 0; i < d->revertList.count(); ++i) {
+ if (d->revertList.at(i).binding()) {
+ d->revertList.at(i).binding()->destroy();
+ }
+ }
}
/*!