altosuilib: Serialize access to async tile notify function in preload
[fw/altos] / altosuilib / AltosUIMapView.java
index 4df178e2e57e6ba676d0f619a30aedc0d6e2b0ce..a14fde6583e42cb64b938a49168dce22c751897f 100644 (file)
@@ -387,7 +387,7 @@ public class AltosUIMapView extends Component implements MouseMotionListener, Mo
        }
 
        /* AltosUIMapTileListener methods */
-       public void notify_tile(AltosUIMapTile tile, int status) {
+       public synchronized void notify_tile(AltosUIMapTile tile, int status) {
                for (Point point : tiles.keySet()) {
                        if (tile == tiles.get(point)) {
                                Point   screen = transform.screen(point);
@@ -399,7 +399,7 @@ public class AltosUIMapView extends Component implements MouseMotionListener, Mo
        public AltosUIMapCache cache() { return cache; }
 
        /* AltosUIMapStoreListener methods */
-       public void notify_store(AltosUIMapStore store, int status) {
+       public synchronized void notify_store(AltosUIMapStore store, int status) {
                if (load_listener != null) {
                        for (AltosUIMapTile tile : tiles.values())
                                if (store.equals(tile.store))