diff options
author | Laszlo Agocs <lagocs83@gmail.com> | 2012-08-31 16:29:11 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-20 07:02:00 +0200 |
commit | aac24582c623a87b65733151b5f6af9771862b66 (patch) | |
tree | 1a7d04e0307e508ded2d105f99197c224669c6ce | |
parent | 4b664eef64d5d51ba8de0e9792ba1c0f9883fa81 (diff) |
Cocoa GL context: do not crash when closing windows
Running hellowindow and closing its windows one by one would result
in crashes without the additional checks for the presence of the
underlying native window.
Change-Id: Id32bdfda9a77936380b2e9a95fb56ceb52028d9d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaglcontext.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 0292e02ff1..4dd19622e1 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -103,7 +103,7 @@ void QCocoaGLContext::setActiveWindow(QWindow *window) if (window == m_currentWindow.data()) return; - if (m_currentWindow) + if (m_currentWindow && m_currentWindow.data()->handle()) static_cast<QCocoaWindow *>(m_currentWindow.data()->handle())->setCurrentContext(0); Q_ASSERT(window->handle()); @@ -119,7 +119,7 @@ void QCocoaGLContext::setActiveWindow(QWindow *window) void QCocoaGLContext::doneCurrent() { - if (m_currentWindow) + if (m_currentWindow && m_currentWindow.data()->handle()) static_cast<QCocoaWindow *>(m_currentWindow.data()->handle())->setCurrentContext(0); m_currentWindow.clear(); |