Mercurial > sdl-ios-xcode
comparison src/video/SDL_cursor.c @ 77:1e7e61b9b0f9
Don't crash if freeing a cursor after quit...
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Tue, 19 Jun 2001 21:07:12 +0000 |
parents | cf2af46e9e2a |
children | e21ac1dd30f1 |
comparison
equal
deleted
inserted
replaced
76:f28fa29a3a0c | 77:1e7e61b9b0f9 |
---|---|
243 if ( cursor ) { | 243 if ( cursor ) { |
244 if ( cursor == SDL_cursor ) { | 244 if ( cursor == SDL_cursor ) { |
245 SDL_SetCursor(SDL_defcursor); | 245 SDL_SetCursor(SDL_defcursor); |
246 } | 246 } |
247 if ( cursor != SDL_defcursor ) { | 247 if ( cursor != SDL_defcursor ) { |
248 SDL_VideoDevice *video = current_video; | |
249 SDL_VideoDevice *this = current_video; | |
250 | |
248 if ( cursor->data ) { | 251 if ( cursor->data ) { |
249 free(cursor->data); | 252 free(cursor->data); |
250 } | 253 } |
251 if ( cursor->save[0] ) { | 254 if ( cursor->save[0] ) { |
252 free(cursor->save[0]); | 255 free(cursor->save[0]); |
253 } | 256 } |
254 if ( cursor->wm_cursor ) { | 257 if ( video && cursor->wm_cursor ) { |
255 SDL_VideoDevice *video = current_video; | |
256 SDL_VideoDevice *this = current_video; | |
257 video->FreeWMCursor(this, cursor->wm_cursor); | 258 video->FreeWMCursor(this, cursor->wm_cursor); |
258 } | 259 } |
259 free(cursor); | 260 free(cursor); |
260 } | 261 } |
261 } | 262 } |