diff options
-rw-r--r-- | src/widgets/widgets/qwidgetanimator.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgetanimator_p.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/widgets/widgets/qwidgetanimator.cpp b/src/widgets/widgets/qwidgetanimator.cpp index edd9d63081..aef967bd65 100644 --- a/src/widgets/widgets/qwidgetanimator.cpp +++ b/src/widgets/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/widgets/widgets/qwidgetanimator_p.h b/src/widgets/widgets/qwidgetanimator_p.h index 5649488c13..98963ce0bc 100644 --- a/src/widgets/widgets/qwidgetanimator_p.h +++ b/src/widgets/widgets/qwidgetanimator_p.h @@ -55,6 +55,7 @@ #include <qobject.h> #include <qhash.h> +#include <qpointer.h> QT_BEGIN_NAMESPACE @@ -79,7 +80,7 @@ private Q_SLOTS: #endif private: - typedef QHash<QWidget*, QPropertyAnimation*> AnimationMap; + typedef QHash<QWidget*, QPointer<QPropertyAnimation> > AnimationMap; AnimationMap m_animation_map; QMainWindowLayout *m_mainWindowLayout; }; |