From fc143416ad0c96708a6ce1409c706801eeb9d976 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Fri, 6 Sep 2024 18:17:19 +0200 Subject: [PATCH] fix crash on exit in fallout2 --- src/dd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dd.c b/src/dd.c index bff1ec8..3f2ea71 100644 --- a/src/dd.c +++ b/src/dd.c @@ -1670,9 +1670,6 @@ ULONG dd_Release() if (g_ddraw.hwnd && IsWindow(g_ddraw.hwnd)) { - /* restore old wndproc, subsequent ddraw creation will otherwise fail */ - real_SetWindowLongA(g_ddraw.hwnd, GWL_WNDPROC, (LONG)g_ddraw.wndproc); - /* restore old window size, required for games that can switch between windowed and fullscreen during runtime */ if (g_ddraw.width) { @@ -1692,6 +1689,9 @@ ULONG dd_Release() (rc.bottom - rc.top), SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER); } + + /* restore old wndproc, subsequent ddraw creation will otherwise fail */ + real_SetWindowLongA(g_ddraw.hwnd, GWL_WNDPROC, (LONG)g_ddraw.wndproc); } memset(&g_ddraw, 0, sizeof(g_ddraw));