From 8512f1b87c37fd9a46d1b256ba5924d3dec40ff9 Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Mon, 3 Feb 2014 23:01:19 -0500 Subject: [PATCH] add logging for the case when haptic is not detected on the joystick as well. --- test/testhotplug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testhotplug.c b/test/testhotplug.c index 00c3d634bef4d..4849a6a73b8b6 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -78,9 +78,13 @@ main(int argc, char *argv[]) haptic = NULL; } } else { - SDL_Log("Joy haptic FAILED!\n"); + SDL_Log("Joy haptic open FAILED!\n"); } } + else + { + SDL_Log("No haptic found\n"); + } } break; case SDL_JOYDEVICEREMOVED: @@ -91,6 +95,7 @@ main(int argc, char *argv[]) if(haptic) { SDL_HapticClose(haptic); + haptic = NULL; } SDL_JoystickClose(joystick); joystick = NULL;