avoid having closeEvent on medMainWindows more than once.