Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
More checks for current GF state were added.
  • Loading branch information
llmike committed May 14, 2009
1 parent de2f583 commit 79a0e5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/video/qnxgf/SDL_gf_input.c
Expand Up @@ -262,6 +262,10 @@ int gf_showcursor(SDL_Cursor* cursor)
{
mdata=(SDL_MouseData*)cursor->mouse->driverdata;
didata=(SDL_DisplayData*)mdata->didata;
if ((didata==NULL) || (mdata==NULL))
{
return;
}
}
else
{
Expand Down Expand Up @@ -405,6 +409,10 @@ void gf_movecursor(SDL_Cursor* cursor)
if (window_id<=0)
{
didata=(SDL_DisplayData*)cursor->mouse->driverdata;
if (didata==NULL)
{
return;
}
}
else
{
Expand Down
7 changes: 6 additions & 1 deletion src/video/qnxgf/SDL_qnxgf.c
Expand Up @@ -208,6 +208,7 @@ static void qnxgf_destroy(SDL_VideoDevice* device)
if (gfdata->gfinitialized!=SDL_FALSE)
{
gf_dev_detach(gfdata->gfdev);
gfdata->gfdev=NULL;
}

if (device->driverdata!=NULL)
Expand Down Expand Up @@ -529,7 +530,7 @@ int qnxgf_videoinit(_THIS)

void qnxgf_videoquit(_THIS)
{
SDL_DisplayData* didata;
SDL_DisplayData* didata=NULL;
uint32_t it;

/* Stop collecting mouse events */
Expand All @@ -546,10 +547,12 @@ void qnxgf_videoquit(_THIS)
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 */
Expand Down Expand Up @@ -581,13 +584,15 @@ void qnxgf_videoquit(_THIS)

/* Detach from layer, free it for others */
gf_layer_detach(didata->layer);
didata->layer=NULL;

/* Mark it as detached */
didata->layer_attached=SDL_FALSE;
}

/* Detach from selected display */
gf_display_detach(didata->display);
didata->display=NULL;
}
}

Expand Down

0 comments on commit 79a0e5a

Please sign in to comment.