Fix a corruption when you remove first joystick on Linux.
Fixes a bug where the joystick subsystem would get corrupted if you unplug the
first of multiple joysticks. Fixes bug 1714.
CR: saml
Binary file Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings has changed
Binary file Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings has changed
Binary file Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings has changed
--- a/src/joystick/linux/SDL_sysjoystick.c Tue Feb 12 13:59:04 2013 -0300
+++ b/src/joystick/linux/SDL_sysjoystick.c Tue Feb 12 11:47:29 2013 -0800
@@ -339,13 +339,12 @@
}
if (prev != NULL) {
prev->next = item->next;
- if (item == SDL_joylist_tail) {
- SDL_joylist_tail = prev;
- }
} else {
- SDL_assert(!SDL_joylist);
- SDL_assert(!SDL_joylist_tail);
- SDL_joylist = SDL_joylist_tail = NULL;
+ SDL_assert(SDL_joylist == item);
+ SDL_joylist = item->next;
+ }
+ if (item == SDL_joylist_tail) {
+ SDL_joylist_tail = prev;
}
SDL_free(item->path);
SDL_free(item->name);