Changeset 14478 in josm for trunk


Ignore:
Timestamp:
2018-12-01T16:56:42+01:00 (6 years ago)
Author:
GerdP
Message:

see #17040 make MapSlider Destroyable

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

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

    r13201 r14478  
    1111import javax.swing.event.ChangeListener;
    1212
     13import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener;
    1314import org.openstreetmap.josm.gui.help.Helpful;
    14 import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener;
     15import org.openstreetmap.josm.tools.Destroyable;
    1516
    1617/**
    1718 * This is the slider used in the top left corner of the map view. It allows the user to select the scale
    1819 */
    19 class MapSlider extends JSlider implements ZoomChangeListener, ChangeListener, Helpful {
     20class MapSlider extends JSlider implements ZoomChangeListener, ChangeListener, Helpful, Destroyable {
    2021
    2122    private static final double ZOOM_STEP = 1.1;
     
    6970        return ht("/MapView/Slider");
    7071    }
     72
     73    /**
     74     * Free resources
     75     */
     76    public void destroy() {
     77        NavigatableComponent.removeZoomChangeListener(this);
     78    }
    7179}
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r14120 r14478  
    7171import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    7272import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintSylesUpdateListener;
     73import org.openstreetmap.josm.gui.util.GuiHelper;
    7374import org.openstreetmap.josm.io.audio.AudioPlayer;
    7475import org.openstreetmap.josm.spi.preferences.Config;
     
    808809        nonChangedLayersBuffer = null;
    809810        offscreenBuffer = null;
     811        GuiHelper.destroyComponents(this, false);
    810812    }
    811813
Note: See TracChangeset for help on using the changeset viewer.