Ensure caches cleared between games

This commit is contained in:
drdev
2014-09-25 16:03:49 +00:00
parent 7fd3b39765
commit 096b4f7e12
2 changed files with 11 additions and 2 deletions

View File

@@ -164,8 +164,6 @@ public class MatchUtil {
} }
}); });
gameViews.clear();
int i = 0; int i = 0;
int avatarIndex = 0; int avatarIndex = 0;
humanCount = 0; humanCount = 0;
@@ -393,6 +391,12 @@ public class MatchUtil {
if (game == null) { return; } if (game == null) { return; }
game = null; game = null;
gameViews.clear();
players.clear();
cards.clear();
spabs.clear();
stackItems.clear();
controller.afterGameEnd(); controller.afterGameEnd();
} }

View File

@@ -157,4 +157,9 @@ public class Cache<K extends IIdentifiable, V extends IIdentifiable> {
cache.keySet().retainAll(Collections2.transform(keys, IIdentifiable.FN_GET_ID)); cache.keySet().retainAll(Collections2.transform(keys, IIdentifiable.FN_GET_ID));
inverseCache.values().retainAll(keys); inverseCache.values().retainAll(keys);
} }
public void clear() {
cache.clear();
inverseCache.clear();
}
} }