Changeset 14951 in josm


Ignore:
Timestamp:
2019-04-01T22:10:50+02:00 (9 months ago)
Author:
GerdP
Message:

fix #17517: Memory leak in ChangesetCacheManager

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

Legend:

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

    r14397 r14951  
    4646            ChangesetCacheManager.getInstance().setVisible(true);
    4747        } else {
    48             ChangesetCacheManager.getInstance().removeWindowListener(changesetCacheManagerClosedHandler);
    4948            ChangesetCacheManager.destroyInstance();
    5049        }
     
    5655            setSelected(false);
    5756            notifySelectedState();
    58             ChangesetCacheManager.getInstance().removeWindowListener(changesetCacheManagerClosedHandler);
    5957        }
    6058    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java

    r14602 r14951  
    6565import org.openstreetmap.josm.io.NetworkManager;
    6666import org.openstreetmap.josm.io.OnlineResource;
    67 import org.openstreetmap.josm.tools.Destroyable;
    6867import org.openstreetmap.josm.tools.ImageProvider;
    6968import org.openstreetmap.josm.tools.InputMapUtils;
     
    104103        if (instance != null) {
    105104            instance.setVisible(false);
     105            GuiHelper.destroyComponents(instance, false);
    106106            instance.dispose();
    107             for (Component c : instance.pnlChangesetDetailTabs.getComponents()) {
    108                 if (c instanceof Destroyable) {
    109                     ((Destroyable) c).destroy();
    110                 }
    111             }
    112107            instance = null;
    113108        }
     
    352347        @Override
    353348        public void windowClosing(WindowEvent e) {
    354             new CancelAction().cancelAndClose();
     349            destroyInstance();
    355350        }
    356351
Note: See TracChangeset for help on using the changeset viewer.