Mercurial > sdl-ios-xcode
changeset 3124:d7174e9f65ce
More checks for current GF state were added.
author | Mike Gorchak <lestat@i.com.ua> |
---|---|
date | Thu, 14 May 2009 11:51:42 +0000 |
parents | 60301ed80050 |
children | d71d8ceda8b3 |
files | src/video/qnxgf/SDL_gf_input.c src/video/qnxgf/SDL_qnxgf.c |
diffstat | 2 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/video/qnxgf/SDL_gf_input.c Thu May 14 11:50:05 2009 +0000 +++ b/src/video/qnxgf/SDL_gf_input.c Thu May 14 11:51:42 2009 +0000 @@ -262,6 +262,10 @@ { mdata=(SDL_MouseData*)cursor->mouse->driverdata; didata=(SDL_DisplayData*)mdata->didata; + if ((didata==NULL) || (mdata==NULL)) + { + return; + } } else { @@ -405,6 +409,10 @@ if (window_id<=0) { didata=(SDL_DisplayData*)cursor->mouse->driverdata; + if (didata==NULL) + { + return; + } } else {
--- a/src/video/qnxgf/SDL_qnxgf.c Thu May 14 11:50:05 2009 +0000 +++ b/src/video/qnxgf/SDL_qnxgf.c Thu May 14 11:51:42 2009 +0000 @@ -208,6 +208,7 @@ if (gfdata->gfinitialized!=SDL_FALSE) { gf_dev_detach(gfdata->gfdev); + gfdata->gfdev=NULL; } if (device->driverdata!=NULL) @@ -529,7 +530,7 @@ void qnxgf_videoquit(_THIS) { - SDL_DisplayData* didata; + SDL_DisplayData* didata=NULL; uint32_t it; /* Stop collecting mouse events */ @@ -546,10 +547,12 @@ if (didata->cursor.cursor.bitmap.image0!=NULL) { SDL_free((void*)didata->cursor.cursor.bitmap.image0); + didata->cursor.cursor.bitmap.image0=NULL; } if (didata->cursor.cursor.bitmap.image1!=NULL) { SDL_free((void*)didata->cursor.cursor.bitmap.image1); + didata->cursor.cursor.bitmap.image1=NULL; } /* Free main surface */ @@ -581,6 +584,7 @@ /* Detach from layer, free it for others */ gf_layer_detach(didata->layer); + didata->layer=NULL; /* Mark it as detached */ didata->layer_attached=SDL_FALSE; @@ -588,6 +592,7 @@ /* Detach from selected display */ gf_display_detach(didata->display); + didata->display=NULL; } }