1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

fix crash on exit in fallout2

This commit is contained in:
FunkyFr3sh 2024-09-06 18:17:19 +02:00
parent 9c18999a11
commit fc143416ad

View File

@ -1670,9 +1670,6 @@ ULONG dd_Release()
if (g_ddraw.hwnd && IsWindow(g_ddraw.hwnd)) 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 */ /* restore old window size, required for games that can switch between windowed and fullscreen during runtime */
if (g_ddraw.width) if (g_ddraw.width)
{ {
@ -1692,6 +1689,9 @@ ULONG dd_Release()
(rc.bottom - rc.top), (rc.bottom - rc.top),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER); 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)); memset(&g_ddraw, 0, sizeof(g_ddraw));