Closing Opened Windows

Is there any quick method to just close all open windows when your applications closes ?

It should do that automatically.

If you needed to control it in some way (e.g. close windows in a particular order), you could loop through all open windows (see the window() command) and do a .close on the ones you wanted to close.