mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +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() {
|
||||
@Override
|
||||
public void run() {
|
||||
Assert.assertTrue( m_jniGamePtr.isRetained() );
|
||||
boolean hasPending = 0 < XwJNI.
|
||||
comms_countPendingPackets( m_jniGamePtr );
|
||||
mGameOverAlert = GameOverAlert
|
||||
.newInstance( m_summary,
|
||||
msg.arg1,
|
||||
(String)msg.obj,
|
||||
hasPending,
|
||||
inArchiveGroup() );
|
||||
show( mGameOverAlert );
|
||||
Log.d( TAG, "makeJNIHandler(): handling GAME_OVER" );
|
||||
Assert.assertTrueNR( m_jniGamePtr.isRetained() );
|
||||
if ( m_jniGamePtr.isRetained() ) {
|
||||
boolean hasPending = 0 < XwJNI.
|
||||
comms_countPendingPackets( m_jniGamePtr );
|
||||
mGameOverAlert = GameOverAlert
|
||||
.newInstance( m_summary,
|
||||
msg.arg1,
|
||||
(String)msg.obj,
|
||||
hasPending,
|
||||
inArchiveGroup() );
|
||||
show( mGameOverAlert );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue