Skip to content

Commit

Permalink
Fixed bug #149
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 12, 2006
1 parent 89c30ef commit 2d90a13
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/video/wincommon/SDL_sysevents.c
Expand Up @@ -746,6 +746,7 @@ int SDL_RegisterApp(char *name, Uint32 style, void *hInst)

/* Only do this once... */
if ( app_registered ) {
++app_registered;
return(0);
}

Expand Down Expand Up @@ -822,12 +823,17 @@ void SDL_UnregisterApp()
WNDCLASS class;

/* 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. */
if ( GetClassInfo(SDL_Instance, SDL_Appname, &class) ) {
UnregisterClass(SDL_Appname, SDL_Instance);
}
app_registered = 0;
SDL_free(SDL_Appname);
SDL_Appname = NULL;
}
}

Expand Down

0 comments on commit 2d90a13

Please sign in to comment.