src/video/windows/SDL_windowswindow.c
changeset 5580 0c407e6d14a9
parent 5535 96594ac5fd1a
child 5581 f40f9d3ca2bc
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Fri Jul 22 00:12:03 2011 -0700
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Mon Jul 25 15:03:42 2011 -0700
     1.3 @@ -636,6 +636,15 @@
     1.4          ReleaseDC(data->hwnd, data->hdc);
     1.5          if (data->created) {
     1.6              DestroyWindow(data->hwnd);
     1.7 +        } else {
     1.8 +            /* Restore any original event handler... */
     1.9 +            if (data->wndproc != NULL) {
    1.10 +#ifdef GWLP_WNDPROC
    1.11 +                SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) data->wndproc);
    1.12 +#else
    1.13 +                SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR) data->wndproc);
    1.14 +#endif
    1.15 +            }
    1.16          }
    1.17          SDL_free(data);
    1.18      }