mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
don't crash on null dctxt
This commit is contained in:
parent
88af10552e
commit
3858893ab2
2 changed files with 24 additions and 17 deletions
|
@ -644,6 +644,7 @@ makeDraw( MPFORMAL JNIEnv** envp, jobject jdraw )
|
|||
void
|
||||
destroyDraw( DrawCtx** dctx )
|
||||
{
|
||||
if ( !!*dctx ) {
|
||||
AndDraw* draw = (AndDraw*)*dctx;
|
||||
JNIEnv* env = *draw->env;
|
||||
if ( NULL != draw->jdraw ) {
|
||||
|
@ -662,3 +663,4 @@ destroyDraw( DrawCtx** dctx )
|
|||
XP_FREE( draw->mpool, draw );
|
||||
*dctx = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -417,7 +417,10 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeNewGame
|
|||
globals->util = makeUtil( MPPARM(mpool) &state->env, j_util, gi,
|
||||
globals );
|
||||
globals->jniutil = makeJNIUtil( MPPARM(mpool) &state->env, jniu );
|
||||
DrawCtx* dctx = makeDraw( MPPARM(mpool) &state->env, j_draw );
|
||||
DrawCtx* dctx = NULL;
|
||||
if ( !!j_draw ) {
|
||||
dctx = makeDraw( MPPARM(mpool) &state->env, j_draw );
|
||||
}
|
||||
globals->dctx = dctx;
|
||||
globals->xportProcs = makeXportProcs( MPPARM(mpool) &state->env, j_procs );
|
||||
CommonPrefs cp;
|
||||
|
@ -486,7 +489,9 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeFromStream
|
|||
globals->jniutil = makeJNIUtil( MPPARM(mpool) &state->env, jniu );
|
||||
makeDicts( MPPARM(mpool) env, globals->jniutil, &dict, &dicts, jdictNames,
|
||||
jdicts, jpaths, jlang );
|
||||
if ( !!jdraw ) {
|
||||
globals->dctx = makeDraw( MPPARM(mpool) &state->env, jdraw );
|
||||
}
|
||||
globals->xportProcs = makeXportProcs( MPPARM(mpool) &state->env, jprocs );
|
||||
|
||||
XWStreamCtxt* stream = streamFromJStream( MPPARM(mpool) env,
|
||||
|
|
Loading…
Reference in a new issue