* java/org/gnu/emacs/EmacsActivity.java (destroy): Detach from
current window before calling finish.
* java/org/gnu/emacs/EmacsWindow.java (reparentTo): Don't clear
attachment state here...
* java/org/gnu/emacs/EmacsWindowManager.java (detachWindow):
...but do so here instead.
(cherry picked from commit
42c0603c7aab191c9cc15a7eca1253060ff5b71a)
public final void
destroy ()
{
+ if (window != null)
+ {
+ /* Clear the window's pointer to this activity and remove the
+ window's view. */
+ window.setConsumer (null);
+
+ /* The window can't be iconified any longer. */
+ window.noticeDeiconified ();
+ layout.removeView (window.view);
+ window = null;
+ }
+
finish ();
}
manager = EmacsWindowManager.MANAGER;
manager.detachWindow (EmacsWindow.this);
- /* Reset window management state. */
- previouslyAttached = false;
- attachmentToken = 0;
-
/* Also unparent this view. */
/* If the window manager is set, use that instead. */
{
WindowConsumer consumer;
- if (window.getAttachedConsumer () != null)
- {
- consumer = window.getAttachedConsumer ();
+ /* Reset window management state. */
+ window.previouslyAttached = false;
+ window.attachmentToken = 0;
+
+ /* Remove WINDOW from the list of active windows. */
+ windows.remove (window);
+ if ((consumer = window.getAttachedConsumer ()) != null)
+ {
consumers.remove (consumer);
consumer.destroy ();
}
- windows.remove (window);
pruneWindows ();
}