| Summary: | [Android] SDL_JoystickGetAttached does not function | ||
|---|---|---|---|
| Product: | SDL | Reporter: | David Brady <dbrady> |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | gabomdq |
| Version: | HG 2.1 | ||
| Hardware: | ARM | ||
| OS: | Android (All) | ||
| Attachments: |
Patch
Patch 2 |
||
Created attachment 1528 [details]
Patch 2
Fix memory leak...
How about just changing line 447 from return !joystick->closed && (joystick->hwdata != NULL); to return !joystick->closed Because closed is only set when SDL_JoystickClose is called, not when it's removed. Should be fixed here: https://hg.libsdl.org/SDL/rev/df0bf33be2ca Thanks for the report! Ah, I didn't read that code carefully enough. I thought that was a different joystick object in the list. Thanks for the fix. |
Created attachment 1527 [details] Patch The controller always reports itself as attached. Patch to fix the problem is attached. I copied over some relevant stuff from the Linux version of this feature.