From 3863a22dc15e2b1f30f9f60a63f046bc50f038df Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 14 Sep 2010 02:54:05 +0200 Subject: [PATCH] Added Win32 window re-creation hack. --- src/win32/win32_window.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/win32/win32_window.c b/src/win32/win32_window.c index d48549d1..3fdbc39f 100644 --- a/src/win32/win32_window.c +++ b/src/win32/win32_window.c @@ -1217,6 +1217,16 @@ static int createWindow(_GLFWwindow* window, static void destroyWindow(_GLFWwindow* window) { + // This is duplicated from glfwCloseWindow + // TODO: Stop duplicating code + if (window == _glfwLibrary.currentWindow) + glfwMakeWindowCurrent(NULL); + + // This is duplicated from glfwCloseWindow + // TODO: Stop duplicating code + if (window == _glfwLibrary.activeWindow) + _glfwLibrary.activeWindow = NULL; + if (window->WGL.context) { wglDeleteContext(window->WGL.context);