Fixed buggy SDL_VIDEO_X11_MOUSEACCEL behaviour...correctly free buffer, and SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Wed, 04 Apr 2007 09:15:39 +0000
branchSDL-1.2
changeset 393079a4c9017550
parent 3929 56ec4d962487
child 3931 d65b4a73c991
Fixed buggy SDL_VIDEO_X11_MOUSEACCEL behaviour...correctly free buffer, and
only call XChangePointerControl() if we have valid arguments.

Fixes Bugzilla #417.
src/video/x11/SDL_x11mouse.c
     1.1 --- a/src/video/x11/SDL_x11mouse.c	Sun Apr 01 03:27:45 2007 +0000
     1.2 +++ b/src/video/x11/SDL_x11mouse.c	Wed Apr 04 09:15:39 2007 +0000
     1.3 @@ -216,11 +216,11 @@
     1.4  			mouse_param = NULL;
     1.5  		}
     1.6  	}
     1.7 -	if ( mouse_param_buf ) {
     1.8 +	if ( i == 3 ) {
     1.9  		XChangePointerControl(SDL_Display, True, True,
    1.10  			accel_value[0], accel_value[1], accel_value[2]);
    1.11 -		SDL_free(mouse_param_buf);
    1.12  	}
    1.13 +	SDL_stack_free(mouse_param_buf);
    1.14  }
    1.15  
    1.16  /* Check to see if we need to enter or leave mouse relative mode */