Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Some more safety around the SDL_HelperWindow stuff to avoid double cr…

…eations.
  • Loading branch information
bobbens committed Jan 18, 2009
1 parent 8d65a9c commit cef9aba5fb71ee77f60e65d83f3b5a5090c10a28
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/video/win32/SDL_win32window.c
@@ -561,6 +561,11 @@ SDL_HelperWindowCreate(void)
HINSTANCE hInstance = GetModuleHandleA(NULL);
WNDCLASSEX wce;

/* Make sure window isn't created twice. */
if (SDL_HelperWindow != NULL) {
return 0;
}

/* Create the class. */
SDL_zero(wce);
wce.cbSize = sizeof(WNDCLASSEX);
@@ -584,6 +589,7 @@ SDL_HelperWindowCreate(void)
CW_USEDEFAULT, HWND_MESSAGE, NULL,
hInstance, NULL);
if (SDL_HelperWindow == NULL) {
UnregisterClass(SDL_HelperWindowClassName, hInstance);
SDL_SetError("Unable to create Helper Window: error %d.",
GetLastError());
return -1;

0 comments on commit cef9aba

Please sign in to comment.