mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
fix delete game problem: delete first using lock we already have.
This commit is contained in:
parent
3a368a8efd
commit
a90ec29ff0
2 changed files with 9 additions and 4 deletions
|
@ -1430,8 +1430,8 @@ public class BoardDelegate extends DelegateBase
|
|||
|
||||
private void deleteAndClose()
|
||||
{
|
||||
GameUtils.deleteGame( m_activity, m_gameLock, false );
|
||||
waitCloseGame( false );
|
||||
GameUtils.deleteGame( m_activity, m_rowid, false );
|
||||
finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -220,6 +220,13 @@ public class GameUtils {
|
|||
return rowid;
|
||||
}
|
||||
|
||||
public static void deleteGame( Context context, GameLock lock, boolean informNow )
|
||||
{
|
||||
tellDied( context, lock, informNow );
|
||||
Utils.cancelNotification( context, (int)lock.getRowid() );
|
||||
DBUtils.deleteGame( context, lock );
|
||||
}
|
||||
|
||||
public static boolean deleteGame( Context context, long rowid,
|
||||
boolean informNow )
|
||||
{
|
||||
|
@ -227,9 +234,7 @@ public class GameUtils {
|
|||
// does this need to be synchronized?
|
||||
GameLock lock = new GameLock( rowid, true );
|
||||
if ( lock.tryLock() ) {
|
||||
tellDied( context, lock, informNow );
|
||||
Utils.cancelNotification( context, (int)rowid );
|
||||
DBUtils.deleteGame( context, lock );
|
||||
deleteGame( context, lock, informNow );
|
||||
lock.unlock();
|
||||
success = true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue