summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsintegration.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index b524adb2cb..7419118878 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -146,7 +146,8 @@ struct QWindowsIntegrationPrivate
# endif
#endif
#ifndef QT_NO_OPENGL
- QSharedPointer<QWindowsStaticOpenGLContext> m_staticOpenGLContext;
+ QMutex m_staticContextLock;
+ QScopedPointer<QWindowsStaticOpenGLContext> m_staticOpenGLContext;
#endif // QT_NO_OPENGL
QScopedPointer<QPlatformInputContext> m_inputContext;
#ifndef QT_NO_ACCESSIBILITY
@@ -464,8 +465,9 @@ QWindowsStaticOpenGLContext *QWindowsIntegration::staticOpenGLContext()
if (!integration)
return 0;
QWindowsIntegrationPrivate *d = integration->d.data();
+ QMutexLocker lock(&d->m_staticContextLock);
if (d->m_staticOpenGLContext.isNull())
- d->m_staticOpenGLContext = QSharedPointer<QWindowsStaticOpenGLContext>(QWindowsStaticOpenGLContext::create());
+ d->m_staticOpenGLContext.reset(QWindowsStaticOpenGLContext::create());
return d->m_staticOpenGLContext.data();
}
#endif // !QT_NO_OPENGL