Ignore:
Timestamp:
2010-08-17T08:08:58+02:00 (14 years ago)
Author:
jttt
Message:

Fix #5331 Memory leak when removing data layers

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

Legend:

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

    r3443 r3444  
    108108    public void destroy() {
    109109        if (sc != null) {
    110             Main.unregisterActionShortcut(sc);
     110            Main.unregisterActionShortcut(this);
    111111        }
    112112        MapView.removeLayerChangeListener(layerChangeAdapter);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r3262 r3444  
    6363    //static private final Logger logger = Logger.getLogger(SelectAction.class.getName());
    6464
    65     /**
    66      * Replies true if we are currently running on OSX
    67      *
    68      * @return true if we are currently running on OSX
    69      */
    70     public static boolean isPlatformOsx() {
    71         return Main.platform != null
    72         && Main.platform instanceof PlatformHookOsx;
    73     }
    74 
    7565    enum Mode { move, rotate, select }
    7666    private Mode mode = null;
     
    274264        // Mac OSX simulates with  ctrl + mouse 1  the second mouse button hence no dragging events get fired.
    275265        //
    276         if (isPlatformOsx() && mode == Mode.rotate) {
     266        if ((Main.platform instanceof PlatformHookOsx) && mode == Mode.rotate) {
    277267            mouseDragged(e);
    278268        }
     
    490480                        if (!nodesToMerge.isEmpty()) {
    491481                            Command cmd = MergeNodesAction.mergeNodes(Main.main.getEditLayer(),nodesToMerge, targetNode);
    492                             if(cmd != null)
     482                            if(cmd != null) {
    493483                                Main.main.undoRedo.add(cmd);
     484                            }
    494485                        }
    495486                    }
Note: See TracChangeset for help on using the changeset viewer.