Changeset 7191 in josm for trunk/src/org


Ignore:
Timestamp:
2014-05-29T17:28:27+02:00 (11 years ago)
Author:
bastiK
Message:

map styles: avoid concurrency problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r7084 r7191  
    1818import org.openstreetmap.josm.gui.NavigatableComponent;
    1919import org.openstreetmap.josm.gui.mappaint.StyleCache.StyleList;
     20import org.openstreetmap.josm.gui.util.GuiHelper;
    2021import org.openstreetmap.josm.tools.Pair;
    2122import org.openstreetmap.josm.tools.Utils;
     
    3738    }
    3839
     40    /**
     41     * Clear the style cache for all primitives of all DataSets.
     42     */
    3943    public void clearCached() {
    40         cacheIdx++;
     44        // run in EDT to make sure this isn't called during rendering run
     45        // {@link org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer#render}
     46        GuiHelper.runInEDT(new Runnable() {
     47            @Override
     48            public void run() {
     49                cacheIdx++;
     50            }
     51        });
    4152    }
    4253
Note: See TracChangeset for help on using the changeset viewer.