summaryrefslogtreecommitdiffstats
path: root/demos/sub-attaq/animationmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'demos/sub-attaq/animationmanager.cpp')
-rw-r--r--demos/sub-attaq/animationmanager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/demos/sub-attaq/animationmanager.cpp b/demos/sub-attaq/animationmanager.cpp
index eb5a125..b3fc8e1 100644
--- a/demos/sub-attaq/animationmanager.cpp
+++ b/demos/sub-attaq/animationmanager.cpp
@@ -62,11 +62,18 @@ AnimationManager *AnimationManager::self()
void AnimationManager::registerAnimation(QAbstractAnimation *anim)
{
+ QObject::connect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*)));
animations.append(anim);
}
+void AnimationManager::unregisterAnimation_helper(QObject *obj)
+{
+ unregisterAnimation(static_cast<QAbstractAnimation*>(obj));
+}
+
void AnimationManager::unregisterAnimation(QAbstractAnimation *anim)
{
+ QObject::disconnect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*)));
animations.removeAll(anim);
}