Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Forgot to alloc the hwdata when opening from joystick.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 6, 2008
1 parent eb9aad6 commit 19423ae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/haptic/win32/SDL_syshaptic.c
Expand Up @@ -565,6 +565,16 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
int ret;

/* Allocate the hwdata */
haptic->hwdata = (struct haptic_hwdata *)
SDL_malloc(sizeof(*haptic->hwdata));
if (haptic->hwdata == NULL) {
SDL_OutOfMemory();
return -1;
}
SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));

/* Now open the device. */
ret = SDL_SYS_HapticOpenFromDevice2( haptic, joystick->hwdata->InputDevice );
if (ret < 0) {
return -1;
Expand Down

0 comments on commit 19423ae

Please sign in to comment.