# HG changeset patch # User Edgar Simo # Date 1218014887 0 # Node ID 83659de20bf2de2264b35201edcd3176bfb4f06e # Parent 4d91a53c6f8a3e631f616d1db73a6c0e54373ab3 Forgot to alloc the hwdata when opening from joystick. diff -r 4d91a53c6f8a -r 83659de20bf2 src/haptic/win32/SDL_syshaptic.c --- a/src/haptic/win32/SDL_syshaptic.c Wed Aug 06 09:24:08 2008 +0000 +++ b/src/haptic/win32/SDL_syshaptic.c Wed Aug 06 09:28:07 2008 +0000 @@ -565,6 +565,16 @@ { 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;