Mercurial > sdl-ios-xcode
comparison src/haptic/darwin/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 | 42b682e85546 |
children | c284ce0cd8e0 |
comparison
equal
deleted
inserted
replaced
2560:2274406ba792 | 2561:3696b9ce8a37 |
---|---|
468 * Closes the haptic device. | 468 * Closes the haptic device. |
469 */ | 469 */ |
470 void | 470 void |
471 SDL_SYS_HapticClose(SDL_Haptic * haptic) | 471 SDL_SYS_HapticClose(SDL_Haptic * haptic) |
472 { | 472 { |
473 int i; | |
474 | |
475 if (haptic->hwdata) { | 473 if (haptic->hwdata) { |
476 | 474 |
477 /* Free the effects. */ | 475 /* Free Effects. */ |
478 for (i=0; i<haptic->neffects; i++) { | |
479 if (haptic->effects[i].hweffect != NULL) { | |
480 SDL_SYS_HapticFreeFFEFFECT(&haptic->effects[i].hweffect->effect, | |
481 haptic->effects[i].effect.type); | |
482 SDL_free(haptic->effects[i].hweffect); | |
483 } | |
484 } | |
485 SDL_free(haptic->effects); | 476 SDL_free(haptic->effects); |
477 haptic->effects = NULL; | |
486 haptic->neffects = 0; | 478 haptic->neffects = 0; |
487 | 479 |
488 /* Clean up */ | 480 /* Clean up */ |
489 FFReleaseDevice(haptic->hwdata->device); | 481 FFReleaseDevice(haptic->hwdata->device); |
490 | 482 |