null pointer fixes and destroy all windows that have a parent (so keep
the main windows)