Changeset 14545 in josm for trunk/src/org


Ignore:
Timestamp:
2018-12-10T10:23:30+01:00 (6 years ago)
Author:
GerdP
Message:

see #17040 - destroy ChangesetInfoAction and UserInfoAction

File:
1 edited

Legend:

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

    r14119 r14545  
    3535import org.openstreetmap.josm.io.XmlWriter;
    3636import org.openstreetmap.josm.spi.preferences.Config;
     37import org.openstreetmap.josm.tools.Destroyable;
    3738import org.openstreetmap.josm.tools.ImageProvider;
    3839import org.openstreetmap.josm.tools.OpenBrowser;
     
    4344 * @since 1709
    4445 */
    45 public class VersionTable extends JTable implements ChangeListener {
     46public class VersionTable extends JTable implements ChangeListener, Destroyable {
    4647    private VersionTablePopupMenu popupMenu;
    4748    private final transient HistoryBrowserModel model;
     
    104105    }
    105106
     107    @Override
     108    public void destroy() {
     109        popupMenu.destroy();
     110    }
     111
    106112    // some kind of hack to prevent the table from scrolling to the
    107113    // right when clicking on the cells
     
    220226    }
    221227
    222     static class VersionTablePopupMenu extends JPopupMenu {
     228    static class VersionTablePopupMenu extends JPopupMenu implements Destroyable {
    223229
    224230        private ChangesetInfoAction changesetInfoAction;
     
    244250            userInfoAction.prepare(primitive);
    245251            invalidate();
     252        }
     253
     254        @Override
     255        public void destroy() {
     256            if (changesetInfoAction != null)
     257                changesetInfoAction.destroy();
     258            if (userInfoAction != null)
     259                userInfoAction.destroy();
    246260        }
    247261    }
Note: See TracChangeset for help on using the changeset viewer.