Closed tripleabuilderbot closed 3 weeks ago
Looks like UnitImageFactory is being used from multiple threads. If it's not supposed to, we can add assertions that we're on the EDT there to catch that. Or if it's supposed to be OK, we can make the collections there synchronized.
It seems that UnitImageFactory is being used from multiple threads already, e.g. via tile drawing code:
java.lang.IllegalStateException: null
at com.google.common.base.Preconditions.checkState(Preconditions.java:499)
at games.strategy.triplea.image.UnitImageFactory.getImage(UnitImageFactory.java:238)
at games.strategy.triplea.ui.screen.UnitsDrawer.draw(UnitsDrawer.java:123)
at games.strategy.triplea.ui.screen.Tile.draw(Tile.java:69)
at games.strategy.triplea.ui.screen.Tile.drawImage(Tile.java:54)
at games.strategy.triplea.ui.panels.map.MapPanel.lambda$paint$9(MapPanel.java:770)
So perhaps we should just make its collections synchronized.
For the case of getIcon(), I think the issue is clearCache() being called outside of EDT via:
data.addGameDataEventListener(
GameDataEvent.TECH_ATTACHMENT_CHANGED, this::clearCachedUnitImages);
So that can be put on EDT, but that doesn't solve the issue of other functions being used outside of EDT...
User Description
On turn 3 of Big World 2: Rise of Axis - normal gameplay
Map
big_world_2 / Big World 2 : Rise of the Axis
Log Message
Failed to map renderingData=[tiger owned by Germans] for event=Heavy Tanks Action: Germans has 1 tiger placed in Western Germany
TripleA Version
2.6.14752
Java Version
11.0.23
Operating System
Linux
Heap Size
1964M
Stack Trace