Index: src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/JosmAction.java	(revision 14703)
+++ src/org/openstreetmap/josm/actions/JosmAction.java	(working copy)
@@ -252,13 +252,16 @@
     public void destroy() {
         if (sc != null && !sc.isAutomatic()) {
             MainApplication.unregisterActionShortcut(this);
+            sc = null;
         }
         if (layerChangeAdapter != null) {
             getLayerManager().removeLayerChangeListener(layerChangeAdapter);
             getLayerManager().removeActiveLayerChangeListener(activeLayerChangeAdapter);
+            layerChangeAdapter = null;
         }
         if (selectionChangeAdapter != null) {
             SelectionEventManager.getInstance().removeSelectionListener(selectionChangeAdapter);
+            selectionChangeAdapter = null;
         }
     }
 
Index: src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 14703)
+++ src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(working copy)
@@ -308,6 +308,5 @@
             case 2: BugReportSender.reportBug(reportHeader); break;
             default: // do nothing
         }
-        GuiHelper.destroyComponents(ed, false);
     }
 }
Index: src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 14703)
+++ src/org/openstreetmap/josm/gui/ExtendedDialog.java	(working copy)
@@ -459,7 +459,9 @@
         super.setVisible(visible);
 
         if (!visible && disposeOnClose) {
+            GuiHelper.destroyComponents(this, false);
             dispose();
+            buttons.clear();
         }
     }
 
Index: src/org/openstreetmap/josm/gui/util/GuiHelper.java
===================================================================
--- src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 14703)
+++ src/org/openstreetmap/josm/gui/util/GuiHelper.java	(working copy)
@@ -33,8 +33,10 @@
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.FutureTask;
 
+import javax.swing.Action;
 import javax.swing.GrayFilter;
 import javax.swing.ImageIcon;
+import javax.swing.JButton;
 import javax.swing.JColorChooser;
 import javax.swing.JComponent;
 import javax.swing.JFileChooser;
@@ -648,17 +650,27 @@
     }
 
     /**
-     * Destroys recursively all {@link Destroyable} components of a given container, and optionnally the container itself.
+     * Destroys recursively all {@link Destroyable} components of a given container, and optionally the container itself.
      * @param component the component to destroy
      * @param destroyItself whether to destroy the component itself
      * @since 14463
      */
     public static void destroyComponents(Component component, boolean destroyItself) {
+
         if (component instanceof Container) {
-            for (Component c: ((Container) component).getComponents()) {
+            for (Component c : ((Container) component).getComponents()) {
                 destroyComponents(c, true);
             }
         }
+        if (component instanceof JButton) {
+            if (!(component instanceof Destroyable)) {
+                Action a = ((JButton) component).getAction();
+                if (a instanceof Destroyable) {
+                    ((Destroyable) a).destroy();
+                }
+                ((JButton) component).setAction(null);
+            }
+        }
         if (destroyItself && component instanceof Destroyable) {
             ((Destroyable) component).destroy();
         }
Index: src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java
===================================================================
--- src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java	(revision 14703)
+++ src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java	(working copy)
@@ -18,7 +18,7 @@
  */
 public class JosmTextArea extends JTextArea implements Destroyable, FocusListener {
 
-    private final PopupMenuLauncher launcher;
+    private PopupMenuLauncher launcher;
 
     /**
      * Constructs a new {@code JosmTextArea}. A default model is set, the initial string
@@ -125,6 +125,9 @@
     @Override
     public void destroy() {
         removeFocusListener(this);
-        TextContextualPopupMenu.disableMenuFor(this, launcher);
+        if (launcher != null) {
+            TextContextualPopupMenu.disableMenuFor(this, launcher);
+            launcher = null;
+        }
     }
 }
Index: src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
===================================================================
--- src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 14703)
+++ src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(working copy)
@@ -131,10 +131,17 @@
     protected TextContextualPopupMenu detach() {
         if (isAttached()) {
             component.removePropertyChangeListener(EDITABLE, propertyChangeListener);
-            removeAll();
             if (undoRedo) {
                 component.getDocument().removeUndoableEditListener(undoEditListener);
+                if (!GraphicsEnvironment.isHeadless()) {
+                    component.getInputMap().put(
+                            KeyStroke.getKeyStroke(KeyEvent.VK_Z, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), null);
+                    component.getInputMap().put(
+                            KeyStroke.getKeyStroke(KeyEvent.VK_Y, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), null);
+                }
             }
+
+            removeAll();
             component = null;
         }
         return this;
