Commit cf3db869 authored by Edgar Simo's avatar Edgar Simo

Some more safety around the SDL_HelperWindow stuff to avoid double creations.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403508
parent ffe056ff
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment