Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32window.c @ 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 | 99210400e8b9 |
children | 09adf4854163 |
comparison
equal
deleted
inserted
replaced
2862:929e7dd10031 | 2863:b632927c28c8 |
---|---|
520 * Destroys the HelperWindow previously created with SDL_HelperWindowCreate. | 520 * Destroys the HelperWindow previously created with SDL_HelperWindowCreate. |
521 */ | 521 */ |
522 void | 522 void |
523 SDL_HelperWindowDestroy(void) | 523 SDL_HelperWindowDestroy(void) |
524 { | 524 { |
525 HINSTANCE hInstance = GetModuleHandleA(NULL); | |
526 | |
525 /* Destroy the window. */ | 527 /* Destroy the window. */ |
526 if (SDL_HelperWindow) { | 528 if (SDL_HelperWindow != NULL) { |
527 DestroyWindow(SDL_HelperWindow); | 529 if (DestroyWindow(SDL_HelperWindow) == 0) { |
530 SDL_SetError("Unable to destroy Helper Window: error %d.", | |
531 GetLastError()); | |
532 return; | |
533 } | |
528 SDL_HelperWindow = NULL; | 534 SDL_HelperWindow = NULL; |
529 } | 535 } |
530 | 536 |
531 /* Unregister the class. */ | 537 /* Unregister the class. */ |
532 if (SDL_HelperWindowClass) { | 538 if (SDL_HelperWindowClass != 0) { |
533 UnregisterClass(SDL_HelperWindowClassName, GetModuleHandleA(NULL)); | 539 if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) { |
540 SDL_SetError("Unable to destroy Helper Window Class: error %d.", | |
541 GetLastError()); | |
542 return; | |
543 } | |
534 SDL_HelperWindowClass = 0; | 544 SDL_HelperWindowClass = 0; |
535 } | 545 } |
536 } | 546 } |
537 | 547 |
538 | 548 |