Login dialog wasn't propertly closing when the window was closed.