Commit 9b1b74e6c0d761dbe9633576910cf53943b68647

Sam Lantinga 2014-07-04T17:20:22

Fixed haptic refcount bug (thanks David Ludwig!)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c
index fbfe14f..596b26e 100644
--- a/src/haptic/SDL_haptic.c
+++ b/src/haptic/SDL_haptic.c
@@ -343,7 +343,7 @@ SDL_HapticClose(SDL_Haptic * haptic)
     }
 
     /* Check if it's still in use */
-    if (--haptic->ref_count < 0) {
+    if (--haptic->ref_count > 0) {
         return;
     }