# HG changeset patch # User Edgar Simo # Date 1229097117 0 # Node ID b632927c28c87bcd46729cdbffbefa844075bc25 # Parent 929e7dd100319c47ebf7fd6623b626a9ad693a0c Some error checking when destroying the HelperWindow. diff -r 929e7dd10031 -r b632927c28c8 src/video/win32/SDL_win32window.c --- a/src/video/win32/SDL_win32window.c Fri Dec 12 06:46:20 2008 +0000 +++ b/src/video/win32/SDL_win32window.c Fri Dec 12 15:51:57 2008 +0000 @@ -522,15 +522,25 @@ void SDL_HelperWindowDestroy(void) { + HINSTANCE hInstance = GetModuleHandleA(NULL); + /* Destroy the window. */ - if (SDL_HelperWindow) { - DestroyWindow(SDL_HelperWindow); + if (SDL_HelperWindow != NULL) { + if (DestroyWindow(SDL_HelperWindow) == 0) { + SDL_SetError("Unable to destroy Helper Window: error %d.", + GetLastError()); + return; + } SDL_HelperWindow = NULL; } /* Unregister the class. */ - if (SDL_HelperWindowClass) { - UnregisterClass(SDL_HelperWindowClassName, GetModuleHandleA(NULL)); + if (SDL_HelperWindowClass != 0) { + if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) { + SDL_SetError("Unable to destroy Helper Window Class: error %d.", + GetLastError()); + return; + } SDL_HelperWindowClass = 0; } }