summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsintegration.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-20 19:31:18 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-20 19:31:19 +0200
commit36c025a8d66b244b6017746b415881ef1814b1e2 (patch)
tree419c55a80f161e3882a3060cbcf0762d7a151841 /src/plugins/platforms/windows/qwindowsintegration.cpp
parentd55f2b1fb9c910bc118f75967a0e6273f8aa98d1 (diff)
parent8e8bd90e4445415df7b7f516444e594d3e678c1a (diff)
Merge 5.7 into 5.7.0
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