mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-01 19:57:11 +01:00
avoid crash by dropping GAME_OVER event
Play Store reports say I'm getting this event when I don't have a valid jni game instance to work with. So test for that, and drop the event. If it's a race condition this should fix it. If not I'll get some other crash report that might be more useful.
This commit is contained in:
parent
dd8e7584e6
commit
e18b2d5c75
1 changed files with 13 additions and 10 deletions
|
@ -2232,16 +2232,19 @@ public class BoardDelegate extends DelegateBase
|
||||||
runOnUiThread( new Runnable() {
|
runOnUiThread( new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Assert.assertTrue( m_jniGamePtr.isRetained() );
|
Log.d( TAG, "makeJNIHandler(): handling GAME_OVER" );
|
||||||
boolean hasPending = 0 < XwJNI.
|
Assert.assertTrueNR( m_jniGamePtr.isRetained() );
|
||||||
comms_countPendingPackets( m_jniGamePtr );
|
if ( m_jniGamePtr.isRetained() ) {
|
||||||
mGameOverAlert = GameOverAlert
|
boolean hasPending = 0 < XwJNI.
|
||||||
.newInstance( m_summary,
|
comms_countPendingPackets( m_jniGamePtr );
|
||||||
msg.arg1,
|
mGameOverAlert = GameOverAlert
|
||||||
(String)msg.obj,
|
.newInstance( m_summary,
|
||||||
hasPending,
|
msg.arg1,
|
||||||
inArchiveGroup() );
|
(String)msg.obj,
|
||||||
show( mGameOverAlert );
|
hasPending,
|
||||||
|
inArchiveGroup() );
|
||||||
|
show( mGameOverAlert );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue