mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-06 05:24:46 +01:00
don't bother saving if no data loaded yet
Fixes, or at least makes extremely unlikely, race condition where one thread makes use of an existing JNIThread instance then releases it before the thread that created it has had a chance to call configure() to actually load the game.
This commit is contained in:
parent
9d95630654
commit
272f8a3960
2 changed files with 2 additions and 1 deletions
|
@ -1261,6 +1261,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_server_1do
|
|||
{
|
||||
jboolean result;
|
||||
XWJNI_START();
|
||||
XP_ASSERT( !!state->game.server );
|
||||
result = server_do( state->game.server );
|
||||
XWJNI_END();
|
||||
return result;
|
||||
|
|
|
@ -766,7 +766,7 @@ public class JNIThread extends Thread {
|
|||
|
||||
if ( stop ) {
|
||||
waitToStop( true );
|
||||
} else {
|
||||
} else if ( null != m_lastSavedState ) { // has configure() run?
|
||||
handle( JNICmd.CMD_SAVE ); // in case releaser has made changes
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue