Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fix a corruption when you remove first joystick on Linux.
Browse files Browse the repository at this point in the history
Fixes a bug where the joystick subsystem would get corrupted if you unplug the
first of multiple joysticks. Fixes bug 1714.


CR: saml
  • Loading branch information
jorgenpt committed Feb 12, 2013
1 parent 0e68e38 commit bb4a38c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Empty file modified Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj 100644 → 100755
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 5 additions & 6 deletions src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -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);
Expand Down

0 comments on commit bb4a38c

Please sign in to comment.