Commit 4cb38efa authored by Sam Lantinga's avatar Sam Lantinga

Don't crash if freeing a cursor after quit...

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4078
parent 4b930af7
...@@ -245,15 +245,16 @@ void SDL_FreeCursor (SDL_Cursor *cursor) ...@@ -245,15 +245,16 @@ void SDL_FreeCursor (SDL_Cursor *cursor)
SDL_SetCursor(SDL_defcursor); SDL_SetCursor(SDL_defcursor);
} }
if ( cursor != SDL_defcursor ) { if ( cursor != SDL_defcursor ) {
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
if ( cursor->data ) { if ( cursor->data ) {
free(cursor->data); free(cursor->data);
} }
if ( cursor->save[0] ) { if ( cursor->save[0] ) {
free(cursor->save[0]); free(cursor->save[0]);
} }
if ( cursor->wm_cursor ) { if ( video && cursor->wm_cursor ) {
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
video->FreeWMCursor(this, cursor->wm_cursor); video->FreeWMCursor(this, cursor->wm_cursor);
} }
free(cursor); free(cursor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment