Mercurial > sdl-ios-xcode
comparison src/joystick/win32/SDL_mmjoystick.c @ 3610:3c1b39d0d1a6
Merged r4121:4122 from branches/SDL-1.2: win32 joystick double-free fix.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 06 Jan 2010 07:26:49 +0000 |
parents | 99210400e8b9 |
children | f7b03b6838cb |
comparison
equal
deleted
inserted
replaced
3609:72a1c4dda07c | 3610:3c1b39d0d1a6 |
---|---|
360 SDL_SYS_JoystickClose(SDL_Joystick * joystick) | 360 SDL_SYS_JoystickClose(SDL_Joystick * joystick) |
361 { | 361 { |
362 if (joystick->hwdata != NULL) { | 362 if (joystick->hwdata != NULL) { |
363 /* free system specific hardware data */ | 363 /* free system specific hardware data */ |
364 SDL_free(joystick->hwdata); | 364 SDL_free(joystick->hwdata); |
365 joystick->hwdata = NULL; | |
365 } | 366 } |
366 } | 367 } |
367 | 368 |
368 /* Function to perform any system-specific joystick related cleanup */ | 369 /* Function to perform any system-specific joystick related cleanup */ |
369 void | 370 void |
371 { | 372 { |
372 int i; | 373 int i; |
373 for (i = 0; i < MAX_JOYSTICKS; i++) { | 374 for (i = 0; i < MAX_JOYSTICKS; i++) { |
374 if (SYS_JoystickName[i] != NULL) { | 375 if (SYS_JoystickName[i] != NULL) { |
375 SDL_free(SYS_JoystickName[i]); | 376 SDL_free(SYS_JoystickName[i]); |
377 SYS_JoystickName[i] = NULL; | |
376 } | 378 } |
377 } | 379 } |
378 } | 380 } |
379 | 381 |
380 | 382 |