Mercurial > sdl-ios-xcode
changeset 2863:b632927c28c8
Some error checking when destroying the HelperWindow.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Fri, 12 Dec 2008 15:51:57 +0000 |
parents | 929e7dd10031 |
children | fe8ea2b39aea |
files | src/video/win32/SDL_win32window.c |
diffstat | 1 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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; } }