mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
dispose any existing draw ctxt before setting another.
This commit is contained in:
parent
d4cf98553c
commit
03b023d506
1 changed files with 7 additions and 3 deletions
|
@ -604,9 +604,13 @@ Java_org_eehouse_android_xw4_jni_XwJNI_board_1setDraw
|
||||||
{
|
{
|
||||||
LOG_FUNC();
|
LOG_FUNC();
|
||||||
XWJNI_START_GLOBALS();
|
XWJNI_START_GLOBALS();
|
||||||
XP_ASSERT( !globals->dctx );
|
|
||||||
globals->dctx = makeDraw( MPPARM(mpool) &state->env, jdraw );
|
DrawCtx* newDraw = makeDraw( MPPARM(mpool) &state->env, jdraw );
|
||||||
board_setDraw( state->game.board, globals->dctx );
|
board_setDraw( state->game.board, newDraw );
|
||||||
|
|
||||||
|
destroyDraw( &globals->dctx );
|
||||||
|
globals->dctx = newDraw;
|
||||||
|
|
||||||
XWJNI_END();
|
XWJNI_END();
|
||||||
LOG_RETURN_VOID();
|
LOG_RETURN_VOID();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue