From cfa6dd3dfebe746b9d0a4628ff843d2b40888c84 Mon Sep 17 00:00:00 2001 From: janwas Date: Thu, 12 Aug 2004 17:18:54 +0000 Subject: [PATCH] bugfix: free GLRC before HDC, but BC still complains that there are unfreed GDI objects This was SVN commit r980. --- source/lib/sysdep/win/wsdl.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/lib/sysdep/win/wsdl.cpp b/source/lib/sysdep/win/wsdl.cpp index a488ccf806..b896dc248f 100755 --- a/source/lib/sysdep/win/wsdl.cpp +++ b/source/lib/sysdep/win/wsdl.cpp @@ -518,6 +518,16 @@ static int wsdl_shutdown() gamma_swap(true); + if(fullscreen) + ChangeDisplaySettings(0, 0); + + if(hGLRC != INVALID_HANDLE_VALUE) + { + wglMakeCurrent(0, 0); + wglDeleteContext(hGLRC); + hGLRC = (HGLRC)INVALID_HANDLE_VALUE; + } + if(hDC != INVALID_HANDLE_VALUE) { ReleaseDC(hWnd, hDC); @@ -530,14 +540,6 @@ static int wsdl_shutdown() hWnd = (HWND)INVALID_HANDLE_VALUE; } - if(hGLRC != INVALID_HANDLE_VALUE) - { - wglMakeCurrent(0, 0); - wglDeleteContext(hGLRC); - ChangeDisplaySettings(0, 0); - - hGLRC = (HGLRC)INVALID_HANDLE_VALUE; - } return 0; }