Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
If we didn't create win32 window, restore its event procedure on dest…
Browse files Browse the repository at this point in the history
…ruction.
  • Loading branch information
icculus committed Jul 25, 2011
1 parent c1d7fca commit 07e0ccb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/video/windows/SDL_windowswindow.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 07e0ccb

Please sign in to comment.