Mercurial > sdl-ios-xcode
comparison src/joystick/win32/SDL_dxjoystick.c @ 2577:72b17d80b426 gsoc2008_force_feedback
Fixed some lone malloc and free.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Thu, 31 Jul 2008 17:27:32 +0000 |
parents | 034440120c38 |
children | bd2a6c70cb29 |
comparison
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 |