This PR removes the stage from the active windows list after the stage gets hidden/closed, preventing a possible NPE in WindowStage::setIconified.
Similar to [JDK-8387626](https://bugs.openjdk.org/browse/JDK-8387626), that got fixed removing the stage from the active windows list after there was a `WindowEvent.DESTROY` event in `GlassWindowEventHandler::get`, in this case the Window::hide` event doesn't produce a `WindowEvent.CLOSE` event. Therefore, the fix goes directly in `WindowStage::close`. A system test that fails before the proposed fix, and passes after it, has been included. --------- - [X] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - Remove stage from active windows list when closed, to prevent NPE, and include test Changes: https://git.openjdk.org/jfx/pull/2373/files Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2373&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8397186 Stats: 125 lines in 2 files changed: 125 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jfx/pull/2373.diff Fetch: git fetch https://git.openjdk.org/jfx.git pull/2373/head:pull/2373 PR: https://git.openjdk.org/jfx/pull/2373
