diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-02-04 16:22:02 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-02-04 16:22:02 +0300 |
commit | b407702c5f13a0d2cf77d6728722d6f909e4d19e (patch) | |
tree | 49533f5e27194f0284f62ab34ce53ee5e6ffc27e /intern | |
parent | f3a19f4324f0400ecc3cdddf01163e78443ea482 (diff) |
Fix [#19997] Duplicating window results in graphics corruption in UI
reported by Micael Dias (and many others, see duplicates list)
On closing the first ("main") Blender window the very first OpenGL context
got deleted too. This context needs to be retained, since we share quite a
bit of OpenGL data through it to the newly created contexts (new windows).
Thanks to Ton Roosendaal for thinking out loud while trying to figure out
what the actual cause was.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 7afd3fef832..f5773ea2d90 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -805,12 +805,10 @@ GHOST_TSuccess GHOST_WindowWin32::removeDrawingContext() GHOST_TSuccess success; switch (m_drawingContextType) { case GHOST_kDrawingContextTypeOpenGL: - if (m_hGlRc) { - bool first = m_hGlRc == s_firsthGLRc; + // we shouldn't remove the drawing context if it's the first OpenGL context + // If we do, we get corrupted drawing. See #19997 + if (m_hGlRc && m_hGlRc!=s_firsthGLRc) { success = ::wglDeleteContext(m_hGlRc) == TRUE ? GHOST_kSuccess : GHOST_kFailure; - if (first) { - s_firsthGLRc = 0; - } m_hGlRc = 0; } else { |