mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
gtk: fix crash when hit rematch button
Not all games have a draw context. Check!
This commit is contained in:
parent
012b015f82
commit
a275730824
1 changed files with 13 additions and 9 deletions
|
@ -176,16 +176,20 @@ 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 );
|
||||||
addSurface( dctx, SNAP_WIDTH, SNAP_HEIGHT );
|
if ( !!dctx ) {
|
||||||
board_drawSnapshot( board, (DrawCtx*)dctx, SNAP_WIDTH, SNAP_HEIGHT );
|
addSurface( dctx, SNAP_WIDTH, SNAP_HEIGHT );
|
||||||
|
board_drawSnapshot( board, (DrawCtx*)dctx, SNAP_WIDTH, SNAP_HEIGHT );
|
||||||
|
|
||||||
XWStreamCtxt* stream = make_simple_stream( cGlobals );
|
XWStreamCtxt* stream = make_simple_stream( cGlobals );
|
||||||
getImage( dctx, stream );
|
getImage( dctx, stream );
|
||||||
removeSurface( dctx );
|
removeSurface( dctx );
|
||||||
sqlite3_int64 newRow = writeBlobColumnStream( stream, cGlobals->pDb,
|
sqlite3_int64 newRow = writeBlobColumnStream( stream, cGlobals->pDb,
|
||||||
cGlobals->selRow, "snap" );
|
cGlobals->selRow, "snap" );
|
||||||
XP_ASSERT( cGlobals->selRow == newRow );
|
XP_ASSERT( cGlobals->selRow == newRow );
|
||||||
stream_destroy( stream );
|
stream_destroy( stream );
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_RETURN_VOID();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue