Fixed bug 2953 - Crash due to a bad cleanup in the SDL_SYS_HapticQuit function Technically this is caused by the haptic devices not being closed at quit time, which we need to fix anyway, but this is a bandaid for now.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c
index 0a2f2a7..0d5c0ef 100644
--- a/src/haptic/SDL_haptic.c
+++ b/src/haptic/SDL_haptic.c
@@ -845,3 +845,4 @@ SDL_HapticRumbleStop(SDL_Haptic * haptic)
return SDL_HapticStopEffect(haptic, haptic->rumble_id);
}
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/haptic/SDL_syshaptic.h b/src/haptic/SDL_syshaptic.h
index 5d8755a..a364f8a 100644
--- a/src/haptic/SDL_syshaptic.h
+++ b/src/haptic/SDL_syshaptic.h
@@ -206,4 +206,3 @@ extern int SDL_SYS_HapticStopAll(SDL_Haptic * haptic);
#endif /* _SDL_syshaptic_h */
/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/src/haptic/darwin/SDL_syshaptic.c b/src/haptic/darwin/SDL_syshaptic.c
index fac5ad0..152f779 100644
--- a/src/haptic/darwin/SDL_syshaptic.c
+++ b/src/haptic/darwin/SDL_syshaptic.c
@@ -683,7 +683,10 @@ SDL_SYS_HapticQuit(void)
IOObjectRelease(item->dev);
SDL_free(item);
}
+
numhaptics = -1;
+ SDL_hapticlist = NULL;
+ SDL_hapticlist_tail = NULL;
}
@@ -1409,5 +1412,6 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
return 0;
}
-
#endif /* SDL_HAPTIC_IOKIT */
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/haptic/dummy/SDL_syshaptic.c b/src/haptic/dummy/SDL_syshaptic.c
index 5bb7ca6..ebff7da 100644
--- a/src/haptic/dummy/SDL_syshaptic.c
+++ b/src/haptic/dummy/SDL_syshaptic.c
@@ -182,3 +182,5 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
}
#endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c
index 7071cc5..f72edfc 100644
--- a/src/haptic/linux/SDL_syshaptic.c
+++ b/src/haptic/linux/SDL_syshaptic.c
@@ -1162,5 +1162,6 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
return 0;
}
-
#endif /* SDL_HAPTIC_LINUX */
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/haptic/windows/SDL_windowshaptic.c b/src/haptic/windows/SDL_windowshaptic.c
index 7b2ef6f..a0b6c55 100644
--- a/src/haptic/windows/SDL_windowshaptic.c
+++ b/src/haptic/windows/SDL_windowshaptic.c
@@ -272,6 +272,10 @@ SDL_SYS_HapticQuit(void)
SDL_XINPUT_HapticQuit();
SDL_DINPUT_HapticQuit();
+
+ numhaptics = 0;
+ SDL_hapticlist = NULL;
+ SDL_hapticlist_tail = NULL;
}
/*