# HG changeset patch # User Edgar Simo # Date 1232298002 0 # Node ID 9acb9f0f7f0ded9a5e188840cdee3371d2c422e1 # Parent b36579172f27d8192757a8a1be13fdc1765e5cdd Some more safety around the SDL_HelperWindow stuff to avoid double creations. diff -r b36579172f27 -r 9acb9f0f7f0d src/video/win32/SDL_win32window.c --- a/src/video/win32/SDL_win32window.c Thu Jan 15 21:35:42 2009 +0000 +++ b/src/video/win32/SDL_win32window.c Sun Jan 18 17:00:02 2009 +0000 @@ -561,6 +561,11 @@ 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 @@ 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;