Search code examples
javauser-interfacejavafxwindow

What Happens to the Controller When the Window is Closed?


If I have a 2 Windows open and both have controllers, what happens to the controller of the closed Window if I close the window (not the root node) from the mentioned controller? Is the controller garbage collected, does any remaining code run?


Solution

  • If no other custom code is holding a reference to the scenegraph produced by the FXML. You could also fire up a memory analyzer like Eclipse MAT to inspect your heap.