diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-10-17 13:04:47 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-10-24 09:00:52 +0000 |
commit | ec00272f749972c49d4eaf858a57c38a5bf30c8b (patch) | |
tree | 3cf0806e56c7ca994332e17d81913d8487bd779d /src/quick | |
parent | dadaa47844f36ba2e598a1d44cfff0cb16384510 (diff) |
QQuickAnimatorProxyJob: Disconnect from window when unsetting it
Otherwise we may get called back when the window's scene graph is ready,
but we don't have a controller anymore then. This leads to a crash.
Change-Id: I8075619e1fd3c69ca0f7d0b1d72952b8cc5040f8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/util/qquickanimatorjob.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp index 3ac02cd259..50fb7090d1 100644 --- a/src/quick/util/qquickanimatorjob.cpp +++ b/src/quick/util/qquickanimatorjob.cpp @@ -197,8 +197,12 @@ void QQuickAnimatorProxyJob::windowChanged(QQuickWindow *window) void QQuickAnimatorProxyJob::setWindow(QQuickWindow *window) { if (!window) { - if (m_job && m_controller) + if (m_job && m_controller) { + disconnect(m_controller->window(), &QQuickWindow::sceneGraphInitialized, + this, &QQuickAnimatorProxyJob::sceneGraphInitialized); m_controller->cancel(m_job); + } + m_controller = nullptr; stop(); |