From 45a6ddf8ecc346e764600466cd4d05575438ad6d Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 25 Oct 2016 08:03:18 -0700 Subject: [PATCH] fix jni crash on Nexus 9: give boolean default value Crash occurs when creating new game: because there's no turn set yet the jboolean has no set value (whatever was on the stack). Apparently the java runtime accepts only 1 and 0 for jbooleans. --- xwords4/android/XWords4/jni/xwjni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/jni/xwjni.c b/xwords4/android/XWords4/jni/xwjni.c index 10b4a491a..a08603736 100644 --- a/xwords4/android/XWords4/jni/xwjni.c +++ b/xwords4/android/XWords4/jni/xwjni.c @@ -1661,7 +1661,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1summarize setInt( env, jsummary, "nMoves", nMoves ); XP_Bool gameOver = server_getGameIsOver( state->game.server ); setBool( env, jsummary, "gameOver", gameOver ); - XP_Bool isLocal; + XP_Bool isLocal = XP_FALSE; setInt( env, jsummary, "turn", server_getCurrentTurn( state->game.server, &isLocal ) ); setBool( env, jsummary, "turnIsLocal", isLocal );