diff options
Diffstat (limited to 'src/corelib/animation/qabstractanimation.cpp')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 8fa4707..7c2d690 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; } |