Commit ee03e101 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #149

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401502
parent cd3a1db9
...@@ -746,6 +746,7 @@ int SDL_RegisterApp(char *name, Uint32 style, void *hInst) ...@@ -746,6 +746,7 @@ int SDL_RegisterApp(char *name, Uint32 style, void *hInst)
/* Only do this once... */ /* Only do this once... */
if ( app_registered ) { if ( app_registered ) {
++app_registered;
return(0); return(0);
} }
...@@ -822,12 +823,17 @@ void SDL_UnregisterApp() ...@@ -822,12 +823,17 @@ void SDL_UnregisterApp()
WNDCLASS class; WNDCLASS class;
/* SDL_RegisterApp might not have been called before */ /* SDL_RegisterApp might not have been called before */
if ( app_registered ) { if ( !app_registered ) {
return;
}
--app_registered;
if ( app_registered == 0 ) {
/* Check for any registered window classes. */ /* Check for any registered window classes. */
if ( GetClassInfo(SDL_Instance, SDL_Appname, &class) ) { if ( GetClassInfo(SDL_Instance, SDL_Appname, &class) ) {
UnregisterClass(SDL_Appname, SDL_Instance); UnregisterClass(SDL_Appname, SDL_Instance);
} }
app_registered = 0; SDL_free(SDL_Appname);
SDL_Appname = NULL;
} }
} }
......
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