[SVN] r3907 - branches/gsoc2008_force_feedback/src/haptic/win32

svn-owner at libsdl.org svn-owner at libsdl.org
Wed Aug 6 02:28:07 PDT 2008


Author: bobbens
Date: 2008-08-06 02:28:07 -0700 (Wed, 06 Aug 2008)
New Revision: 3907

Modified:
   branches/gsoc2008_force_feedback/src/haptic/win32/SDL_syshaptic.c
Log:
Forgot to alloc the hwdata when opening from joystick.


Modified: branches/gsoc2008_force_feedback/src/haptic/win32/SDL_syshaptic.c
===================================================================
--- branches/gsoc2008_force_feedback/src/haptic/win32/SDL_syshaptic.c	2008-08-06 09:24:08 UTC (rev 3906)
+++ branches/gsoc2008_force_feedback/src/haptic/win32/SDL_syshaptic.c	2008-08-06 09:28:07 UTC (rev 3907)
@@ -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;



More information about the SVN mailing list