Minor corrections. gsoc2008_force_feedback
authorEdgar Simo <bobbens@gmail.com>
Thu, 10 Jul 2008 16:42:43 +0000
branchgsoc2008_force_feedback
changeset 2514 840e1b6325c0
parent 2513 55fd9103a330
child 2515 030fc4375e63
Minor corrections.
src/haptic/SDL_haptic.c
--- a/src/haptic/SDL_haptic.c	Thu Jul 10 11:39:28 2008 +0000
+++ b/src/haptic/SDL_haptic.c	Thu Jul 10 16:42:43 2008 +0000
@@ -27,7 +27,6 @@
 
 Uint8 SDL_numhaptics = 0;
 SDL_Haptic **SDL_haptics = NULL;
-static SDL_Haptic *default_haptic = NULL;
 
 
 /*
@@ -44,15 +43,15 @@
    if (status >= 0) {
       arraylen = (status + 1) * sizeof(*SDL_haptics);
       SDL_haptics = (SDL_Haptic **) SDL_malloc(arraylen);
-      if (SDL_haptics == NULL) {
+      if (SDL_haptics == NULL) { /* Out of memory. */
          SDL_numhaptics = 0;
-      } else {
+      }
+      else {
          SDL_memset(SDL_haptics, 0, arraylen);
          SDL_numhaptics = status;
       }
       status = 0;
    }
-   default_haptic = NULL;
 
    return status;
 }
@@ -336,13 +335,12 @@
 void
 SDL_HapticQuit(void)
 {
-   SDL_numhaptics = 0;
-
    SDL_SYS_HapticQuit();
    if (SDL_haptics != NULL) {
       SDL_free(SDL_haptics);
       SDL_haptics = NULL;
    }
+   SDL_numhaptics = 0;
 }
 
 /*