summaryrefslogtreecommitdiff
path: root/src/corelib/animation
diff options
context:
space:
mode:
authorNick Ratelle <nratelle@qnx.com>2012-01-05 16:48:58 -0500
committerQt by Nokia <qt-info@nokia.com>2012-02-08 23:32:47 +0100
commit95a857c2d3212c0a19aefd11ff960df56d413acc (patch)
treec6f2e60176eea1b48611c04ddd9278fccd626dc1 /src/corelib/animation
parent2906a96486d079b00bf4c640f84833b8194c4fee (diff)
downloadqt4-tools-95a857c2d3212c0a19aefd11ff960df56d413acc.tar.gz
Fixed null pointer dereference in QUnifiedTimer
Change-Id: I8b7ab19a98e2920fc020043088c32d073aa1d60d Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/animation')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 8fa4707b0f..7c2d690d51 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -392,13 +392,16 @@ int QUnifiedTimer::closestPauseAnimationTimeToFinish()
void QUnifiedTimer::installAnimationDriver(QAnimationDriver *d)
{
- if (driver->isRunning()) {
- qWarning("QUnifiedTimer: Cannot change animation driver while animations are running");
- return;
- }
+ if (driver) {
+
+ if (driver->isRunning()) {
+ qWarning("QUnifiedTimer: Cannot change animation driver while animations are running");
+ return;
+ }
- if (driver && driver != &defaultDriver)
- delete driver;
+ if (driver != &defaultDriver)
+ delete driver;
+ }
driver = d;
}