src/video/wincommon/SDL_sysevents.c
changeset 1498 3968f7cba10c
parent 1497 420b3f47806d
child 1505 4d005dfbb7f5
     1.1 --- a/src/video/wincommon/SDL_sysevents.c	Sat Mar 11 23:46:45 2006 +0000
     1.2 +++ b/src/video/wincommon/SDL_sysevents.c	Sun Mar 12 00:57:50 2006 +0000
     1.3 @@ -746,6 +746,7 @@
     1.4  
     1.5  	/* Only do this once... */
     1.6  	if ( app_registered ) {
     1.7 +		++app_registered;
     1.8  		return(0);
     1.9  	}
    1.10  
    1.11 @@ -822,12 +823,17 @@
    1.12  	WNDCLASS class;
    1.13  
    1.14  	/* SDL_RegisterApp might not have been called before */
    1.15 -	if ( app_registered ) {
    1.16 +	if ( !app_registered ) {
    1.17 +		return;
    1.18 +	}
    1.19 +	--app_registered;
    1.20 +	if ( app_registered == 0 ) {
    1.21  		/* Check for any registered window classes. */
    1.22  		if ( GetClassInfo(SDL_Instance, SDL_Appname, &class) ) {
    1.23  			UnregisterClass(SDL_Appname, SDL_Instance);
    1.24  		}
    1.25 -		app_registered = 0;
    1.26 +		SDL_free(SDL_Appname);
    1.27 +		SDL_Appname = NULL;
    1.28  	}
    1.29  }
    1.30