summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-03-06 14:17:57 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-03-06 19:27:11 +0000
commitd7401c32c5eb514da639753d939fafabd9d3492f (patch)
tree7fa9bd266edc91d4a82e778c7371e7329d7c933b /src/plugins
parent95d385466dc367532b3da5e4e38533b20288ac28 (diff)
Avoid crashing when there is no QWindowsIntegration anymore
When destroying the QWindowsIntegration, the global instance is set to null in the destructor. This is followed by a lot of additional steps when destroying the members. Some of that cleanup calls to staticOpenGLContext() which was not handling the case of the integration global instance being null. Change-Id: Ib74faf491d4c81635934547968ec91e9dceec6e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 62df7918c1..9fd18a1ef4 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -420,7 +420,10 @@ QOpenGLContext::OpenGLModuleType QWindowsIntegration::openGLModuleType()
QWindowsStaticOpenGLContext *QWindowsIntegration::staticOpenGLContext()
{
- QWindowsIntegrationPrivate *d = QWindowsIntegration::instance()->d.data();
+ QWindowsIntegration *integration = QWindowsIntegration::instance();
+ if (!integration)
+ return 0;
+ QWindowsIntegrationPrivate *d = integration->d.data();
if (d->m_staticOpenGLContext.isNull())
d->m_staticOpenGLContext = QSharedPointer<QWindowsStaticOpenGLContext>(QWindowsStaticOpenGLContext::create());
return d->m_staticOpenGLContext.data();