src/haptic/linux/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2561 3696b9ce8a37
parent 2556 fe346eddd3fb
child 2634 dbd63c419ba5
--- 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. */