Changeset 14672 in josm for trunk


Ignore:
Timestamp:
2019-01-10T09:42:03+01:00 (3 months ago)
Author:
GerdP
Message:

fix #17184: fix leaks in ValidateUploadHook and ValidatorTreePanel.destroy()

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java

    r14473 r14672  
    2727import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2828import org.openstreetmap.josm.gui.layer.ValidatorLayer;
     29import org.openstreetmap.josm.gui.util.GuiHelper;
    2930import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    3031import org.openstreetmap.josm.tools.GBC;
     
    149150            .setButtonIcons("ok", "cancel")
    150151            .setContent(p);
    151 
    152         if (ed.showDialog().getValue() != 1) {
     152        int rc = ed.showDialog().getValue();
     153        GuiHelper.destroyComponents(ed, false);
     154        ed.dispose();
     155        if (rc != 1) {
    153156            OsmValidator.initializeTests();
    154157            OsmValidator.initializeErrorLayer();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r14251 r14672  
    2525import javax.swing.tree.TreeSelectionModel;
    2626
    27 import org.openstreetmap.josm.data.osm.DataSet;
    2827import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2928import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent;
     
    4241import org.openstreetmap.josm.data.validation.TestError;
    4342import org.openstreetmap.josm.data.validation.util.MultipleNameVisitor;
    44 import org.openstreetmap.josm.gui.MainApplication;
    4543import org.openstreetmap.josm.gui.util.GuiHelper;
    4644import org.openstreetmap.josm.tools.Destroyable;
     
    410408    public void destroy() {
    411409        DatasetEventManager.getInstance().removeDatasetListener(this);
    412         DataSet ds = MainApplication.getLayerManager().getActiveDataSet();
    413         if (ds != null) {
    414             ds.removeDataSetListener(this);
    415         }
     410        ToolTipManager.sharedInstance().unregisterComponent(this);
    416411        clearErrors();
    417412    }
Note: See TracChangeset for help on using the changeset viewer.