Fixed crash:
authorSam Lantinga <slouken@libsdl.org>
Mon, 30 Jan 2006 13:30:44 +0000
changeset 1296f418917e0b7a
parent 1295 c3e36ac8a94c
child 1297 7b32c7a586c9
Fixed crash:
#include <SDL.h>

int main(int argc, char** argv)
{
SDL_Init(SDL_INIT_EVERYTHING);
SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN);
SDL_ShowCursor(SDL_DISABLE);
SDL_Delay(1000);
SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN | SDL_OPENGL);
SDL_Quit();
printf("Everything okay\n");
}
src/video/SDL_cursor.c
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_cursor.c	Mon Jan 30 06:56:10 2006 +0000
     1.2 +++ b/src/video/SDL_cursor.c	Mon Jan 30 13:30:44 2006 +0000
     1.3 @@ -208,9 +208,9 @@
     1.4  	if ( SDL_cursor && (SDL_cursorstate&CURSOR_VISIBLE) ) {
     1.5  		/* Use window manager cursor if possible */
     1.6  		if ( SDL_cursor->wm_cursor && 
     1.7 -	             video->ShowWMCursor(this, SDL_cursor->wm_cursor) )
     1.8 +	             video->ShowWMCursor(this, SDL_cursor->wm_cursor) ) {
     1.9  			SDL_cursorstate &= ~CURSOR_USINGSW;
    1.10 -		else {
    1.11 +		} else {
    1.12  			SDL_cursorstate |= CURSOR_USINGSW;
    1.13  			if ( video->ShowWMCursor ) {
    1.14  				video->ShowWMCursor(this, NULL);
     2.1 --- a/src/video/SDL_video.c	Mon Jan 30 06:56:10 2006 +0000
     2.2 +++ b/src/video/SDL_video.c	Mon Jan 30 13:30:44 2006 +0000
     2.3 @@ -643,6 +643,7 @@
     2.4  	/* Reset the keyboard here so event callbacks can run */
     2.5  	SDL_ResetKeyboard();
     2.6  	SDL_ResetMouse();
     2.7 +	SDL_cursorstate &= ~CURSOR_USINGSW;
     2.8  
     2.9  	/* Clean up any previous video mode */
    2.10  	if ( SDL_PublicSurface != NULL ) {