From 17968c433c5258602eb15b45b0971c346dbfaea5 Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Mon, 8 Nov 2010 21:42:23 +0200 Subject: [PATCH] Fix a recursive call when DirectDraw is created more than once --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index 5ed413c..af98da6 100644 --- a/main.c +++ b/main.c @@ -370,6 +370,8 @@ ULONG __stdcall ddraw_Release(IDirectDrawImpl *This) if(This->Ref == 0) { + /* restore old wndproc, subsequent ddraw creation will otherwise fail */ + SetWindowLong(This->hWnd, GWL_WNDPROC, (LONG)This->WndProc); //free(This); ddraw = NULL; return 0;