Fixed test programs for joystick not exiting on events after first disconnect.

Exit was broken since the main loop extraction needed for Emscripten support
because the former local but now global variables were not reset correctly.
This commit is contained in:
Philipp Wiesemann 2015-02-12 21:40:53 +01:00
parent 16369a4919
commit d9c3c62015
2 changed files with 11 additions and 0 deletions

View file

@ -176,6 +176,8 @@ WatchJoystick(SDL_Joystick * joystick)
{
SDL_Window *window = NULL;
const char *name = NULL;
retval = SDL_FALSE;
done = SDL_FALSE;
/* Create a window to display joystick axis position */
@ -217,6 +219,7 @@ WatchJoystick(SDL_Joystick * joystick)
#endif
SDL_DestroyRenderer(screen);
screen = NULL;
SDL_DestroyWindow(window);
return retval;
}