Changeset 15521 in josm for trunk/src


Ignore:
Timestamp:
2019-11-12T23:28:15+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #18313 - proper toolbar cleanup when JOSM actions are destroyed

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

Legend:

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

    r15404 r15521  
    279279            SelectionEventManager.getInstance().removeSelectionListener(selectionChangeAdapter);
    280280        }
     281        MainApplication.getToolbar().unregister(this);
    281282    }
    282283
  • trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java

    r15154 r15521  
    1717import java.util.Map;
    1818import java.util.Map.Entry;
    19 import java.util.Optional;
    2019import java.util.stream.Collectors;
    2120
     
    301300    private void removeDynamicItem(Object item) {
    302301        if (item instanceof JMenuItem) {
    303             Optional.ofNullable(((JMenuItem) item).getAction()).ifPresent(MainApplication.getToolbar()::unregister);
    304302            remove((JMenuItem) item);
    305303        } else if (item instanceof MenuComponent) {
Note: See TracChangeset for help on using the changeset viewer.