[SDL] segfault when trying to close joystick

nescivi nescivi at gmail.com
Sun Mar 10 09:01:28 PDT 2013


Hi,

I'm running into a bug when I try to close a joystick.

In SDL_sysjoystick.c (around line 984) it crashes just after the close( joystick->hwdata->fd ), when the function returns from this, joystick->hwdata is reset to a NULL pointer, and the following if statement crashes.

I'm not sure why this happens...

sincerely,
Marije

void
SDL_SYS_JoystickClose(SDL_Joystick * joystick)
{
    if (joystick->hwdata) {
        close(joystick->hwdata->fd);
        if (joystick->hwdata->item) {
            joystick->hwdata->item->hwdata = NULL;
        }




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130310/7848d6af/attachment-0008.htm>


More information about the SDL mailing list