mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
fix (by inspection) three Play store crashes
One race condition between BT threads; two edge cases around dialog fragments, where I've left DEBUG build asserts in place.
This commit is contained in:
parent
935932f440
commit
d584c30a43
3 changed files with 14 additions and 9 deletions
|
@ -489,6 +489,8 @@ public class BTService extends XWService {
|
|||
Log.w( TAG, "trying again..." );
|
||||
logIOE( ioe);
|
||||
continue;
|
||||
} catch ( NullPointerException npe ) {
|
||||
continue; // m_serverSocket probably null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -122,18 +122,21 @@ public class DBAlert extends XWDialogFragment {
|
|||
new Handler().post( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MainActivity activity = (MainActivity)getActivity();
|
||||
if ( null != activity ) {
|
||||
DBAlert newMe = newInstance( getDlgID(), mParams );
|
||||
activity.show( newMe );
|
||||
dismiss(); // kill myself...
|
||||
} else {
|
||||
Log.d( TAG, "null activity..." );
|
||||
try {
|
||||
MainActivity activity = (MainActivity)getActivity();
|
||||
if ( null != activity ) {
|
||||
DBAlert newMe = newInstance( getDlgID(), mParams );
|
||||
activity.show( newMe );
|
||||
dismiss(); // kill myself...
|
||||
} else {
|
||||
Log.d( TAG, "null activity..." );
|
||||
}
|
||||
} catch ( IllegalStateException ex ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -341,7 +341,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
break;
|
||||
}
|
||||
|
||||
Assert.assertNotNull( dialog );
|
||||
Assert.assertTrue( dialog != null || !BuildConfig.DEBUG );
|
||||
return dialog;
|
||||
} // makeDialog
|
||||
|
||||
|
|
Loading…
Reference in a new issue