Mercurial > sdl-ios-xcode
comparison src/haptic/linux/SDL_syshaptic.c @ 2561:3696b9ce8a37 gsoc2008_force_feedback
Correctness patch, it's up to the SDL_haptic.c to clean up effects, not SDL_syshaptic.c.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Thu, 31 Jul 2008 09:45:27 +0000 |
parents | fe346eddd3fb |
children | dbd63c419ba5 |
comparison
equal
deleted
inserted
replaced
2560:2274406ba792 | 2561:3696b9ce8a37 |
---|---|
421 void | 421 void |
422 SDL_SYS_HapticClose(SDL_Haptic * haptic) | 422 SDL_SYS_HapticClose(SDL_Haptic * haptic) |
423 { | 423 { |
424 if (haptic->hwdata) { | 424 if (haptic->hwdata) { |
425 | 425 |
426 /* Free effects. */ | |
427 SDL_free(haptic->effects); | |
428 haptic->effects = NULL; | |
429 haptic->neffects = 0; | |
430 | |
426 /* Clean up */ | 431 /* Clean up */ |
427 close(haptic->hwdata->fd); | 432 close(haptic->hwdata->fd); |
428 | 433 |
429 /* Free */ | 434 /* Free */ |
430 SDL_free(haptic->hwdata); | 435 SDL_free(haptic->hwdata); |
431 SDL_free(haptic->effects); | 436 haptic->hwdata = NULL; |
432 } | 437 } |
433 | 438 |
434 /* Clear the rest. */ | 439 /* Clear the rest. */ |
435 SDL_memset(haptic, 0, sizeof(SDL_Haptic)); | 440 SDL_memset(haptic, 0, sizeof(SDL_Haptic)); |
436 } | 441 } |