From bb4a38c08dc0a690fda317252f973d31ff23c185 Mon Sep 17 00:00:00 2001 From: "J?rgen P. Tjern?" Date: Tue, 12 Feb 2013 11:47:29 -0800 Subject: [PATCH] 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 --- Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj | 0 .../English.lproj/InfoPlist.strings | Bin 588 -> 588 bytes .../English.lproj/InfoPlist.strings | Bin 588 -> 588 bytes .../English.lproj/InfoPlist.strings | Bin 588 -> 588 bytes src/joystick/linux/SDL_sysjoystick.c | 11 +++++------ 5 files changed, 5 insertions(+), 6 deletions(-) mode change 100644 => 100755 Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj diff --git a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj old mode 100644 new mode 100755 diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings index e612457676d964a8021d20ec90290d5c6c3d88c1..38224b5a6dc9494230bdffbcad9c8bd915f478d9 100755 GIT binary patch delta 13 UcmX@Za)yQJ|G$mQo=l7k04L%Epa1{> delta 12 TcmX@Za)yQZ-+zXUOrA^tB1QzC diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings index e612457676d964a8021d20ec90290d5c6c3d88c1..38224b5a6dc9494230bdffbcad9c8bd915f478d9 100755 GIT binary patch delta 13 UcmX@Za)yQJ|G$mQo=l7k04L%Epa1{> delta 12 TcmX@Za)yQZ-+zXUOrA^tB1QzC diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings index e612457676d964a8021d20ec90290d5c6c3d88c1..38224b5a6dc9494230bdffbcad9c8bd915f478d9 100755 GIT binary patch delta 13 UcmX@Za)yQJ|G$mQo=l7k04L%Epa1{> delta 12 TcmX@Za)yQZ-+zXUOrA^tB1QzC diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index e5192be8f..b91efa3a7 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -339,13 +339,12 @@ MaybeRemoveDevice(const char *path) } 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);