Commit ad8b9f88 authored by Mike Gorchak's avatar Mike Gorchak

More checks for current GF state were added.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403606
parent 9c65a7a5
...@@ -262,6 +262,10 @@ int gf_showcursor(SDL_Cursor* cursor) ...@@ -262,6 +262,10 @@ int gf_showcursor(SDL_Cursor* cursor)
{ {
mdata=(SDL_MouseData*)cursor->mouse->driverdata; mdata=(SDL_MouseData*)cursor->mouse->driverdata;
didata=(SDL_DisplayData*)mdata->didata; didata=(SDL_DisplayData*)mdata->didata;
if ((didata==NULL) || (mdata==NULL))
{
return;
}
} }
else else
{ {
...@@ -405,6 +409,10 @@ void gf_movecursor(SDL_Cursor* cursor) ...@@ -405,6 +409,10 @@ void gf_movecursor(SDL_Cursor* cursor)
if (window_id<=0) if (window_id<=0)
{ {
didata=(SDL_DisplayData*)cursor->mouse->driverdata; didata=(SDL_DisplayData*)cursor->mouse->driverdata;
if (didata==NULL)
{
return;
}
} }
else else
{ {
......
...@@ -208,6 +208,7 @@ static void qnxgf_destroy(SDL_VideoDevice* device) ...@@ -208,6 +208,7 @@ static void qnxgf_destroy(SDL_VideoDevice* device)
if (gfdata->gfinitialized!=SDL_FALSE) if (gfdata->gfinitialized!=SDL_FALSE)
{ {
gf_dev_detach(gfdata->gfdev); gf_dev_detach(gfdata->gfdev);
gfdata->gfdev=NULL;
} }
if (device->driverdata!=NULL) if (device->driverdata!=NULL)
...@@ -529,7 +530,7 @@ int qnxgf_videoinit(_THIS) ...@@ -529,7 +530,7 @@ int qnxgf_videoinit(_THIS)
void qnxgf_videoquit(_THIS) void qnxgf_videoquit(_THIS)
{ {
SDL_DisplayData* didata; SDL_DisplayData* didata=NULL;
uint32_t it; uint32_t it;
/* Stop collecting mouse events */ /* Stop collecting mouse events */
...@@ -546,10 +547,12 @@ void qnxgf_videoquit(_THIS) ...@@ -546,10 +547,12 @@ void qnxgf_videoquit(_THIS)
if (didata->cursor.cursor.bitmap.image0!=NULL) if (didata->cursor.cursor.bitmap.image0!=NULL)
{ {
SDL_free((void*)didata->cursor.cursor.bitmap.image0); SDL_free((void*)didata->cursor.cursor.bitmap.image0);
didata->cursor.cursor.bitmap.image0=NULL;
} }
if (didata->cursor.cursor.bitmap.image1!=NULL) if (didata->cursor.cursor.bitmap.image1!=NULL)
{ {
SDL_free((void*)didata->cursor.cursor.bitmap.image1); SDL_free((void*)didata->cursor.cursor.bitmap.image1);
didata->cursor.cursor.bitmap.image1=NULL;
} }
/* Free main surface */ /* Free main surface */
...@@ -581,6 +584,7 @@ void qnxgf_videoquit(_THIS) ...@@ -581,6 +584,7 @@ void qnxgf_videoquit(_THIS)
/* Detach from layer, free it for others */ /* Detach from layer, free it for others */
gf_layer_detach(didata->layer); gf_layer_detach(didata->layer);
didata->layer=NULL;
/* Mark it as detached */ /* Mark it as detached */
didata->layer_attached=SDL_FALSE; didata->layer_attached=SDL_FALSE;
...@@ -588,6 +592,7 @@ void qnxgf_videoquit(_THIS) ...@@ -588,6 +592,7 @@ void qnxgf_videoquit(_THIS)
/* Detach from selected display */ /* Detach from selected display */
gf_display_detach(didata->display); gf_display_detach(didata->display);
didata->display=NULL;
} }
} }
......
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