Skip to content

Commit

Permalink
Fixed bug 2953 - Crash due to a bad cleanup in the SDL_SYS_HapticQuit…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
slouken committed Jun 15, 2015
1 parent a4eb0de commit e3df6d5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/haptic/SDL_haptic.c
Expand Up @@ -845,3 +845,4 @@ SDL_HapticRumbleStop(SDL_Haptic * haptic)
return SDL_HapticStopEffect(haptic, haptic->rumble_id);
}

/* vi: set ts=4 sw=4 expandtab: */
1 change: 0 additions & 1 deletion src/haptic/SDL_syshaptic.h
Expand Up @@ -206,4 +206,3 @@ extern int SDL_SYS_HapticStopAll(SDL_Haptic * haptic);
#endif /* _SDL_syshaptic_h */

/* vi: set ts=4 sw=4 expandtab: */

6 changes: 5 additions & 1 deletion src/haptic/darwin/SDL_syshaptic.c
Expand Up @@ -683,7 +683,10 @@ SDL_SYS_HapticQuit(void)
IOObjectRelease(item->dev);
SDL_free(item);
}

numhaptics = -1;
SDL_hapticlist = NULL;
SDL_hapticlist_tail = NULL;
}


Expand Down Expand Up @@ -1409,5 +1412,6 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
return 0;
}


#endif /* SDL_HAPTIC_IOKIT */

/* vi: set ts=4 sw=4 expandtab: */
2 changes: 2 additions & 0 deletions src/haptic/dummy/SDL_syshaptic.c
Expand Up @@ -182,3 +182,5 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
}

#endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */

/* vi: set ts=4 sw=4 expandtab: */
3 changes: 2 additions & 1 deletion src/haptic/linux/SDL_syshaptic.c
Expand Up @@ -1162,5 +1162,6 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
return 0;
}


#endif /* SDL_HAPTIC_LINUX */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/haptic/windows/SDL_windowshaptic.c
Expand Up @@ -272,6 +272,10 @@ SDL_SYS_HapticQuit(void)

SDL_XINPUT_HapticQuit();
SDL_DINPUT_HapticQuit();

numhaptics = 0;
SDL_hapticlist = NULL;
SDL_hapticlist_tail = NULL;
}

/*
Expand Down

0 comments on commit e3df6d5

Please sign in to comment.