src/joystick/win32/SDL_dxjoystick.c
branchgsoc2008_force_feedback
changeset 2577 72b17d80b426
parent 2576 034440120c38
child 2579 bd2a6c70cb29
equal deleted inserted replaced
2576:034440120c38 2577:72b17d80b426
   213     dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
   213     dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
   214 
   214 
   215 
   215 
   216     /* allocate memory for system specific hardware data */
   216     /* allocate memory for system specific hardware data */
   217     joystick->hwdata =
   217     joystick->hwdata =
   218         (struct joystick_hwdata *) malloc(sizeof(struct joystick_hwdata));
   218         (struct joystick_hwdata *) SDL_malloc(sizeof(struct joystick_hwdata));
   219     if (joystick->hwdata == NULL) {
   219     if (joystick->hwdata == NULL) {
   220         SDL_OutOfMemory();
   220         SDL_OutOfMemory();
   221         return (-1);
   221         return (-1);
   222     }
   222     }
   223     SDL_memset(joystick->hwdata, 0, sizeof(struct joystick_hwdata));
   223     SDL_memset(joystick->hwdata, 0, sizeof(struct joystick_hwdata));
   633     IDirectInputDevice2_Unacquire(joystick->hwdata->InputDevice);
   633     IDirectInputDevice2_Unacquire(joystick->hwdata->InputDevice);
   634     IDirectInputDevice2_Release(joystick->hwdata->InputDevice);
   634     IDirectInputDevice2_Release(joystick->hwdata->InputDevice);
   635 
   635 
   636     if (joystick->hwdata != NULL) {
   636     if (joystick->hwdata != NULL) {
   637         /* free system specific hardware data */
   637         /* free system specific hardware data */
   638         free(joystick->hwdata);
   638        SDL_free(joystick->hwdata);
   639     }
   639     }
   640 }
   640 }
   641 
   641 
   642 /* Function to perform any system-specific joystick related cleanup */
   642 /* Function to perform any system-specific joystick related cleanup */
   643 void
   643 void