gtk: fix crash when hit rematch button

Not all games have a draw context. Check!
This commit is contained in:
Eric House 2016-08-05 18:37:35 -07:00
parent 012b015f82
commit a275730824

View file

@ -176,6 +176,7 @@ addSnap( CommonGlobals* cGlobals )
BoardCtxt* board = cGlobals->game.board; BoardCtxt* board = cGlobals->game.board;
GtkDrawCtx* dctx = (GtkDrawCtx*)board_getDraw( board ); GtkDrawCtx* dctx = (GtkDrawCtx*)board_getDraw( board );
if ( !!dctx ) {
addSurface( dctx, SNAP_WIDTH, SNAP_HEIGHT ); addSurface( dctx, SNAP_WIDTH, SNAP_HEIGHT );
board_drawSnapshot( board, (DrawCtx*)dctx, SNAP_WIDTH, SNAP_HEIGHT ); board_drawSnapshot( board, (DrawCtx*)dctx, SNAP_WIDTH, SNAP_HEIGHT );
@ -188,6 +189,9 @@ addSnap( CommonGlobals* cGlobals )
stream_destroy( stream ); stream_destroy( stream );
} }
LOG_RETURN_VOID();
}
void void
summarize( CommonGlobals* cGlobals ) summarize( CommonGlobals* cGlobals )
{ {