mirror of
https://github.com/yawut/SDL.git
synced 2026-06-12 03:32:06 -05:00
Some error checking when destroying the HelperWindow.
This commit is contained in:
parent
369350caa0
commit
409cae2c08
|
|
@ -522,15 +522,25 @@ SDL_HelperWindowCreate(void)
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user