Changeset 10959 in josm for trunk


Ignore:
Timestamp:
2016-09-04T18:01:25+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #13507 - safer management of listeners for Layer color property

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r10824 r10959  
    388388    @Override
    389389    public void destroy() {
     390        super.destroy();
    390391        SystemOfMeasurement.removeSoMChangeListener(drawHelper);
    391392    }
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r10824 r10959  
    221221        AbstractProperty<Color> colorProperty = getColorProperty();
    222222        if (colorProperty != null) {
    223             colorProperty.addWeakListener(invalidateListener);
     223            colorProperty.addListener(invalidateListener);
    224224        }
    225225    }
     
    285285    public void destroy() {
    286286        // Override in subclasses if needed
     287        removeColorPropertyListener();
    287288    }
    288289
     
    651652        return v.getBounds();
    652653    }
     654
     655    @Override
     656    public String toString() {
     657        return getClass().getSimpleName() + " [name=" + name + ", associatedFile=" + associatedFile + ']';
     658    }
    653659}
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r10879 r10959  
    934934    @Override
    935935    public void destroy() {
     936        super.destroy();
    936937        DataSet.removeSelectionListener(this);
    937938    }
Note: See TracChangeset for help on using the changeset viewer.