Changeset 14931 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2019-03-25T18:53:02+01:00 (6 years ago)
Author:
GerdP
Message:

see #17469: Fix memory leak: destroy JosmAction

File:
1 edited

Legend:

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

    r14912 r14931  
    102102    /** The lookup action */
    103103    private final transient LookupAction lookupAction;
     104    private final transient JosmAction ignoreForNowAction;
    104105
    105106    private final JPopupMenu popupMenu = new JPopupMenu();
     
    123124        InputMapUtils.unassignCtrlShiftUpDown(tree, JComponent.WHEN_FOCUSED);
    124125
    125         JosmAction ignoreForNowAction = new JosmAction(tr("Ignore for now"), "dialogs/delete",
     126        ignoreForNowAction = new JosmAction(tr("Ignore for now"), "dialogs/delete",
    126127                tr("Ignore and remove from tree."), Shortcut.registerShortcut("tools:validate:ignore-for-now",
    127128                        tr("Ignore and remove from tree."), KeyEvent.VK_MINUS, Shortcut.SHIFT),
     
    735736        }
    736737    }
     738
     739    @Override
     740    public void destroy() {
     741        super.destroy();
     742        if (ignoreForNowAction != null) {
     743            ignoreForNowAction.destroy();
     744        }
     745    }
    737746}
Note: See TracChangeset for help on using the changeset viewer.