Index: applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java
===================================================================
--- applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java	(revision 18962)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java	(revision 19058)
@@ -6,6 +6,7 @@
 import org.openstreetmap.josm.gui.IconToggleButton;
 import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
 import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
 import org.openstreetmap.josm.plugins.Plugin;
 
@@ -36,5 +37,5 @@
             currentLayer = new MeasurementLayer(tr("Measurements"));
             Main.main.addLayer(currentLayer);
-            Layer.listeners.add(new LayerChangeListener(){
+            MapView.addLayerChangeListener(new LayerChangeListener(){
                 public void activeLayerChange(final Layer oldLayer, final Layer newLayer) {
                     if(newLayer instanceof MeasurementLayer)
@@ -44,4 +45,6 @@
                 }
                 public void layerRemoved(final Layer oldLayer) {
+                	if (oldLayer != null && oldLayer == currentLayer)
+                		MapView.removeLayerChangeListener(this);
                 }
             });
