diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-08-19 14:42:31 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-19 15:06:17 +0000 |
commit | b8f145547e5477cd67f464c2d834f60a84f4aad6 (patch) | |
tree | 72ae362175efb9e0697eea8f1d326d2d8ba2fb3e /src/quick/scenegraph/qsgcontext_p.h | |
parent | 863a76281cefd19d7e339a78a63c86dff0f9dcce (diff) |
Fix race-condition crash on shut-down in QtWebEngine
If a QQuickWidget is somehow deleted below a QApplication post-routine
it may end up being deleted after QQuickRenderControlPrivate::cleanup(),
which means its QSGContext is deleted.
Change-Id: I396d236f997b7b68a96f8fdddd7d6c3fe31c10b0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgcontext_p.h')
-rw-r--r-- | src/quick/scenegraph/qsgcontext_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h index 43cf1c28ab..899278843e 100644 --- a/src/quick/scenegraph/qsgcontext_p.h +++ b/src/quick/scenegraph/qsgcontext_p.h @@ -139,7 +139,8 @@ public Q_SLOTS: void textureFactoryDestroyed(QObject *o); protected: - QSGContext *m_sg; + // Hold m_sg with QPointer in the rare case it gets deleted before us. + QPointer<QSGContext> m_sg; QMutex m_mutex; QHash<QQuickTextureFactory *, QSGTexture *> m_textures; |