mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +01:00
fix reported NPE: try 100ms to get lock then give up
I suspect it's really rare to fail to get the lock when the game's not open, but hope that trying 100ms before giving up will make failure to save rare enough to be ok.
This commit is contained in:
parent
7b30921190
commit
dae24f55d4
1 changed files with 3 additions and 10 deletions
|
@ -1246,19 +1246,12 @@ public class GameConfigDelegate extends DelegateBase
|
|||
if ( null != m_jniThread ) {
|
||||
applyChanges( m_jniThread.getLock(), forceNew );
|
||||
} else {
|
||||
try ( GameLock lock = GameLock.tryLock( m_rowid ) ) {
|
||||
try ( GameLock lock = GameLock.lock( m_rowid, 100L ) ) {
|
||||
applyChanges( lock, forceNew );
|
||||
} catch ( GameLock.GameLockedException gle ) {
|
||||
Log.e( TAG, "applyChanges(): failed to get lock" );
|
||||
}
|
||||
}
|
||||
// }
|
||||
// GameLock gameLock = m_jniThread == null
|
||||
// ? GameLock.tryLock( m_rowid ) : m_jniThread.getLock();
|
||||
// GameUtils.applyChanges( m_activity, m_gi, m_car, m_disabMap,
|
||||
// gameLock, forceNew );
|
||||
// DBUtils.saveThumbnail( m_activity, gameLock, null ); // clear it
|
||||
// if ( null == m_jniThread ) {
|
||||
// gameLock.unlock();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue