[QNX] Fix crash when creating eglSurface

Change-Id: I9cf9d56003a5f237dcf00b621fddf74e8d0ca190
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
This commit is contained in:
Fabian Bumberger 2014-02-01 11:34:25 +01:00 committed by The Qt Project
parent 30d199a76c
commit 29cd7db616

View File

@ -134,6 +134,8 @@ void QQnxEglWindow::swapEGLBuffers()
EGLSurface QQnxEglWindow::getSurface()
{
if (m_newSurfaceRequested.testAndSetOrdered(true, false)) {
const QMutexLocker locker(&m_mutex); //Set geomety must not reset the requestedBufferSize till
//the surface is created
if (m_eglSurface != EGL_NO_SURFACE) {
platformOpenGLContext()->doneCurrent();
destroyEGLSurface();
@ -165,7 +167,6 @@ void QQnxEglWindow::setGeometry(const QRect &rect)
QSize QQnxEglWindow::requestedBufferSize() const
{
const QMutexLocker locker(&m_mutex);
return m_requestedBufferSize;
}
@ -213,7 +214,6 @@ int QQnxEglWindow::pixelFormat() const
void QQnxEglWindow::resetBuffers()
{
const QMutexLocker locker(&m_mutex);
m_requestedBufferSize = QSize();
}