[Commits] SDL: If we didn't create win32 window, restore its event procedu...

libsdl.org revision control commits-owner at libsdl.org
Tue Jul 26 08:51:09 PDT 2011


details:   http://hg.libsdl.org/SDL/rev/0c407e6d14a9
changeset: 5580:0c407e6d14a9
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Mon Jul 25 15:03:42 2011 -0700
description:
If we didn't create win32 window, restore its event procedure on destruction.

diffstat:

 src/video/windows/SDL_windowswindow.c |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r c8862e1bc41f -r 0c407e6d14a9 src/video/windows/SDL_windowswindow.c
--- a/src/video/windows/SDL_windowswindow.c	Fri Jul 22 00:12:03 2011 -0700
+++ b/src/video/windows/SDL_windowswindow.c	Mon Jul 25 15:03:42 2011 -0700
@@ -636,6 +636,15 @@
         ReleaseDC(data->hwnd, data->hdc);
         if (data->created) {
             DestroyWindow(data->hwnd);
+        } else {
+            /* Restore any original event handler... */
+            if (data->wndproc != NULL) {
+#ifdef GWLP_WNDPROC
+                SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) data->wndproc);
+#else
+                SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR) data->wndproc);
+#endif
+            }
         }
         SDL_free(data);
     }


More information about the commits mailing list