add logging for the case when haptic is not detected on the joystick as well.
authorEdward Rudd <urkle@outoforder.cc>
Mon, 03 Feb 2014 23:01:19 -0500
changeset 8165 2b8ba3d53a67
parent 8164 478fbe1f032f
child 8166 d1be9ce49463
add logging for the case when haptic is not detected on the joystick as well.
test/testhotplug.c
--- a/test/testhotplug.c	Mon Feb 03 22:52:18 2014 -0500
+++ b/test/testhotplug.c	Mon Feb 03 23:01:19 2014 -0500
@@ -78,9 +78,13 @@
                                     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 @@
                         if(haptic)
                         {
                             SDL_HapticClose(haptic);
+                            haptic = NULL;
                         }
                         SDL_JoystickClose(joystick);
                         joystick = NULL;