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