mirror of
https://github.com/yawut/SDL.git
synced 2026-06-09 18:10:33 -05:00
If we didn't create win32 window, restore its event procedure on destruction.
This commit is contained in:
parent
632f5e5860
commit
95dc99af0f
|
|
@ -636,6 +636,15 @@ WIN_DestroyWindow(_THIS, SDL_Window * window)
|
|||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user