Ignore:
Timestamp:
2011-03-05T12:49:25+01:00 (14 years ago)
Author:
hampelratte
Message:

Ticket #6034

Synchronized method updateLayer as it gets called by 2 different threads. This resulted in a race condition where the OsbLayer has been added two times to the layer dialog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java

    r25473 r25518  
    240240    }
    241241
    242     private void updateLayer(DataSet osbData) {
     242    private synchronized void updateLayer(DataSet osbData) {
    243243        if(layer == null) {
    244244            layer = new OsbLayer(osbData, "OpenStreetBugs", dialog);
     
    262262    public void layerRemoved(Layer oldLayer) {
    263263        if(oldLayer == layer) {
    264             MapView.removeLayerChangeListener(this);
    265             MapView.removeLayerChangeListener(dialog);
    266264            layer = null;
    267265        }
Note: See TracChangeset for help on using the changeset viewer.