Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 29525)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 29526)
@@ -505,7 +505,10 @@
         mModelessDialog = new VBoxMediaManagerDlg (0, Qt::Window);
         mModelessDialog->centerAccording (aCenterWidget);
-        connect (vboxGlobal().mainWindow(), SIGNAL (closing()), mModelessDialog, SLOT (close()));
         mModelessDialog->setAttribute (Qt::WA_DeleteOnClose);
         mModelessDialog->setup (VBoxDefs::MediumType_All, false /* aDoSelect */, aRefresh);
+
+        /* Setup 'closing' connection if main window is VBoxSelectorWnd: */
+        if (vboxGlobal().mainWindow() && vboxGlobal().mainWindow()->inherits("VBoxSelectorWnd"))
+            connect(vboxGlobal().mainWindow(), SIGNAL(closing()), mModelessDialog, SLOT(close()));
 
         /* listen to events that may change the media status and refresh
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp	(revision 29525)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp	(revision 29526)
@@ -49,5 +49,4 @@
         id->centerAccording (pMachineWindow->machineWindow());
         // TODO_NEW_CORE: this seems not necessary, cause we set WA_DeleteOnClose.
-        connect (vboxGlobal().mainWindow(), SIGNAL (closing()), id, SLOT (close()));
         id->setAttribute (Qt::WA_DeleteOnClose);
         mSelfArray [machine.GetName()] = id;
@@ -146,5 +145,4 @@
         VBoxVMInformationDlg *id = new VBoxVMInformationDlg (aConsole, aSession, Qt::Window);
         id->centerAccording (aConsole);
-        connect (vboxGlobal().mainWindow(), SIGNAL (closing()), id, SLOT (close()));
         id->setAttribute (Qt::WA_DeleteOnClose);
         mSelfArray [machine.GetName()] = id;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.cpp	(revision 29525)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.cpp	(revision 29526)
@@ -418,6 +418,7 @@
 #endif /* Q_WS_MAC */
 
-    /* Setup connections */
-    connect(vboxGlobal().mainWindow(), SIGNAL(closing()), this, SLOT(reject()));
+    /* Setup 'closing' connection if main window is VBoxSelectorWnd: */
+    if (vboxGlobal().mainWindow() && vboxGlobal().mainWindow()->inherits("VBoxSelectorWnd"))
+        connect(vboxGlobal().mainWindow(), SIGNAL(closing()), this, SLOT(reject()));
 }
 
