diff 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
line wrap: on
line diff
--- a/src/haptic/linux/SDL_syshaptic.c	Thu Jul 31 09:02:43 2008 +0000
+++ b/src/haptic/linux/SDL_syshaptic.c	Thu Jul 31 09:45:27 2008 +0000
@@ -423,12 +423,17 @@
 {
    if (haptic->hwdata) {
 
+      /* Free effects. */
+      SDL_free(haptic->effects);
+      haptic->effects = NULL;
+      haptic->neffects = 0;
+
       /* Clean up */
       close(haptic->hwdata->fd);
 
       /* Free */
-      SDL_free(haptic->hwdata);
-      SDL_free(haptic->effects);
+      SDL_free(haptic->hwdata);                                           
+      haptic->hwdata = NULL;  
    }
 
    /* Clear the rest. */