summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/qwidgetanimator.cpp4
-rw-r--r--src/gui/widgets/qwidgetanimator_p.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/widgets/qwidgetanimator.cpp b/src/gui/widgets/qwidgetanimator.cpp
index 81d94ba..073b24c 100644
--- a/src/gui/widgets/qwidgetanimator.cpp
+++ b/src/gui/widgets/qwidgetanimator.cpp
@@ -59,7 +59,9 @@ void QWidgetAnimator::abort(QWidget *w)
return;
QPropertyAnimation *anim = *it;
m_animation_map.erase(it);
- anim->stop();
+ if (anim) {
+ anim->stop();
+ }
#ifndef QT_NO_MAINWINDOW
m_mainWindowLayout->animationFinished(w);
#endif
diff --git a/src/gui/widgets/qwidgetanimator_p.h b/src/gui/widgets/qwidgetanimator_p.h
index c3d4c0d..9528415 100644
--- a/src/gui/widgets/qwidgetanimator_p.h
+++ b/src/gui/widgets/qwidgetanimator_p.h
@@ -55,6 +55,7 @@
#include <qobject.h>
#include <qmap.h>
+#include <qpointer.h>
QT_BEGIN_NAMESPACE
@@ -79,7 +80,7 @@ private Q_SLOTS:
#endif
private:
- typedef QMap<QWidget*, QPropertyAnimation*> AnimationMap;
+ typedef QMap<QWidget*, QPointer<QPropertyAnimation> > AnimationMap;
AnimationMap m_animation_map;
QMainWindowLayout *m_mainWindowLayout;
};