comparison src/video/wincommon/SDL_sysevents.c @ 1498:3968f7cba10c

Fixed bug #149
author Sam Lantinga <slouken@libsdl.org>
date Sun, 12 Mar 2006 00:57:50 +0000
parents 420b3f47806d
children 4d005dfbb7f5
comparison
equal deleted inserted replaced
1497:420b3f47806d 1498:3968f7cba10c
744 HMODULE handle; 744 HMODULE handle;
745 #endif 745 #endif
746 746
747 /* Only do this once... */ 747 /* Only do this once... */
748 if ( app_registered ) { 748 if ( app_registered ) {
749 ++app_registered;
749 return(0); 750 return(0);
750 } 751 }
751 752
752 #ifndef CS_BYTEALIGNCLIENT 753 #ifndef CS_BYTEALIGNCLIENT
753 #define CS_BYTEALIGNCLIENT 0 754 #define CS_BYTEALIGNCLIENT 0
820 void SDL_UnregisterApp() 821 void SDL_UnregisterApp()
821 { 822 {
822 WNDCLASS class; 823 WNDCLASS class;
823 824
824 /* SDL_RegisterApp might not have been called before */ 825 /* SDL_RegisterApp might not have been called before */
825 if ( app_registered ) { 826 if ( !app_registered ) {
827 return;
828 }
829 --app_registered;
830 if ( app_registered == 0 ) {
826 /* Check for any registered window classes. */ 831 /* Check for any registered window classes. */
827 if ( GetClassInfo(SDL_Instance, SDL_Appname, &class) ) { 832 if ( GetClassInfo(SDL_Instance, SDL_Appname, &class) ) {
828 UnregisterClass(SDL_Appname, SDL_Instance); 833 UnregisterClass(SDL_Appname, SDL_Instance);
829 } 834 }
830 app_registered = 0; 835 SDL_free(SDL_Appname);
836 SDL_Appname = NULL;
831 } 837 }
832 } 838 }
833 839
834 #ifndef NO_GETKEYBOARDSTATE 840 #ifndef NO_GETKEYBOARDSTATE
835 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */ 841 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */