Index: applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java
===================================================================
--- applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java	(revision 18962)
+++ applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java	(revision 19054)
@@ -16,6 +16,7 @@
 import org.openstreetmap.josm.Main;
 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.gui.preferences.PreferenceSetting;
 import org.openstreetmap.josm.plugins.Plugin;
@@ -236,7 +237,7 @@
 				newFrame.addToggleDialog(laneDialog);
 			}
-			Layer.listeners.add(this);
+			MapView.addLayerChangeListener(this);
 		} else {
-			Layer.listeners.remove(this);
+			MapView.removeLayerChangeListener(this);
 		}
 	}
Index: applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java
===================================================================
--- applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java	(revision 18962)
+++ applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java	(revision 19054)
@@ -24,8 +24,8 @@
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
 import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
 import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
 import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
 import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
 import org.openstreetmap.josm.plugins.graphview.core.graph.GraphEdge;
 import org.openstreetmap.josm.plugins.graphview.core.graph.GraphNode;
@@ -84,5 +84,5 @@
 	public GraphViewLayer() {
 		super("Graph view");
-		Layer.listeners.add(this);
+		MapView.addLayerChangeListener(this);
 	}
 
@@ -343,5 +343,7 @@
 	}
 	public void layerRemoved(Layer oldLayer) {
-		//do nothing
+		if (oldLayer == this) {
+			MapView.removeLayerChangeListener(this);
+		}
 	}
 }
