Cocoa (OpenGL): If no view is attached, makeCurrent() should return false

Change-Id: Ie2869fae1549c3b0a8ef78702410e6ca0c980737
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2013-11-04 16:12:38 +01:00 committed by The Qt Project
parent a199a87ad5
commit 2eb1e28a90

View File

@ -112,6 +112,8 @@ bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
QWindow *window = static_cast<QCocoaWindow *>(surface)->window();
setActiveWindow(window);
if (![m_context view])
return false;
[m_context makeCurrentContext];
update();
return true;