Some error checking when destroying the HelperWindow.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403325
This commit is contained in:
parent
1d49195b8c
commit
f6dfd2babf
1 changed files with 14 additions and 4 deletions
|
@ -522,15 +522,25 @@ SDL_HelperWindowCreate(void)
|
||||||
void
|
void
|
||||||
SDL_HelperWindowDestroy(void)
|
SDL_HelperWindowDestroy(void)
|
||||||
{
|
{
|
||||||
|
HINSTANCE hInstance = GetModuleHandleA(NULL);
|
||||||
|
|
||||||
/* Destroy the window. */
|
/* Destroy the window. */
|
||||||
if (SDL_HelperWindow) {
|
if (SDL_HelperWindow != NULL) {
|
||||||
DestroyWindow(SDL_HelperWindow);
|
if (DestroyWindow(SDL_HelperWindow) == 0) {
|
||||||
|
SDL_SetError("Unable to destroy Helper Window: error %d.",
|
||||||
|
GetLastError());
|
||||||
|
return;
|
||||||
|
}
|
||||||
SDL_HelperWindow = NULL;
|
SDL_HelperWindow = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unregister the class. */
|
/* Unregister the class. */
|
||||||
if (SDL_HelperWindowClass) {
|
if (SDL_HelperWindowClass != 0) {
|
||||||
UnregisterClass(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
|
if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) {
|
||||||
|
SDL_SetError("Unable to destroy Helper Window Class: error %d.",
|
||||||
|
GetLastError());
|
||||||
|
return;
|
||||||
|
}
|
||||||
SDL_HelperWindowClass = 0;
|
SDL_HelperWindowClass = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue