Index: trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java	(revision 5512)
+++ trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java	(revision 5513)
@@ -315,4 +315,5 @@
     @Override
     public void destroy() {
+        super.destroy();
         adjustAction.destroy();
     }
Index: trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java	(revision 5512)
+++ trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java	(revision 5513)
@@ -166,5 +166,5 @@
             startGrabberThreads();
         }
-        
+
         Main.pref.addPreferenceChangeListener(this);
     }
@@ -257,4 +257,5 @@
     @Override
     public void destroy() {
+        super.destroy();
         cancelGrabberThreads(false);
         Main.pref.removePreferenceChangeListener(this);
@@ -975,7 +976,6 @@
     public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         int sfv = in.readInt();
-        if (sfv != serializeFormatVersion) {
+        if (sfv != serializeFormatVersion)
             throw new InvalidClassException(tr("Unsupported WMS file version; found {0}, expected {1}", sfv, serializeFormatVersion));
-        }
         autoDownloadEnabled = false;
         dax = in.readInt();
@@ -986,5 +986,5 @@
         info.setExtendedUrl((String)in.readObject());
         images = (GeorefImage[][])in.readObject();
-        
+
         for (GeorefImage[] imgs : images) {
             for (GeorefImage img : imgs) {
@@ -994,5 +994,5 @@
             }
         }
-        
+
         settingsChanged = true;
         if (Main.isDisplayingMapView()) {
