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
This commit is contained in:
parent
7ecccf3fbd
commit
781ab3764f
5 changed files with 5 additions and 6 deletions
0
Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
Normal file → Executable file
0
Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
Normal file → Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -339,14 +339,13 @@ MaybeRemoveDevice(const char *path)
|
||||||
}
|
}
|
||||||
if (prev != NULL) {
|
if (prev != NULL) {
|
||||||
prev->next = item->next;
|
prev->next = item->next;
|
||||||
|
} else {
|
||||||
|
SDL_assert(SDL_joylist == item);
|
||||||
|
SDL_joylist = item->next;
|
||||||
|
}
|
||||||
if (item == SDL_joylist_tail) {
|
if (item == SDL_joylist_tail) {
|
||||||
SDL_joylist_tail = prev;
|
SDL_joylist_tail = prev;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
SDL_assert(!SDL_joylist);
|
|
||||||
SDL_assert(!SDL_joylist_tail);
|
|
||||||
SDL_joylist = SDL_joylist_tail = NULL;
|
|
||||||
}
|
|
||||||
SDL_free(item->path);
|
SDL_free(item->path);
|
||||||
SDL_free(item->name);
|
SDL_free(item->name);
|
||||||
SDL_free(item);
|
SDL_free(item);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue