diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp
index 300790fe1300bc3e28c81d30cd75ce50e6cf0e6c..a99fab23c52765cf5df7354b04be64d682b17c57 100644
--- a/src/plugins/coreplugin/icore.cpp
+++ b/src/plugins/coreplugin/icore.cpp
@@ -340,7 +340,7 @@ void ICore::showNewItemDialog(const QString &title,
 {
     QTC_ASSERT(!isNewItemDialogRunning(), return);
     auto newDialog = new NewDialog(dialogParent());
-    connect(newDialog, &QObject::destroyed, &ICore::validateNewDialogIsRunning);
+    connect(newDialog, &QObject::destroyed, m_instance, &ICore::validateNewDialogIsRunning);
     newDialog->setWizardFactories(factories, defaultLocation, extraVariables);
     newDialog->setWindowTitle(title);
     newDialog->showDialog();
diff --git a/src/plugins/coreplugin/iwizardfactory.cpp b/src/plugins/coreplugin/iwizardfactory.cpp
index f3548e19fb6e1e3892cfac9d8201e76a89586650..0c5033c0a5d34071c74038f58470a544d7efc164 100644
--- a/src/plugins/coreplugin/iwizardfactory.cpp
+++ b/src/plugins/coreplugin/iwizardfactory.cpp
@@ -339,8 +339,6 @@ void IWizardFactory::destroyFeatureProvider()
 
 void IWizardFactory::clearWizardFactories()
 {
-    QTC_ASSERT(!ICore::isNewItemDialogRunning(), return);
-
     foreach (IWizardFactory *factory, s_allFactories)
         ActionManager::unregisterAction(factory->m_action, actionId(factory));
 
diff --git a/src/plugins/coreplugin/windowsupport.cpp b/src/plugins/coreplugin/windowsupport.cpp
index 5c46a1fbeef223b1e749fbe057ea364667c42ea5..174102093b2737a65114ab59b5c5a9768592ffcd 100644
--- a/src/plugins/coreplugin/windowsupport.cpp
+++ b/src/plugins/coreplugin/windowsupport.cpp
@@ -84,18 +84,22 @@ WindowSupport::WindowSupport(QWidget *window, const Context &context)
     connect(m_toggleFullScreenAction, SIGNAL(triggered()), this, SLOT(toggleFullScreen()));
 
     WindowList::addWindow(window);
+
+    connect(ICore::instance(), &ICore::coreAboutToClose, this, [this]() { m_shutdown = true; });
 }
 
 WindowSupport::~WindowSupport()
 {
-    if (UseMacShortcuts) {
-        ActionManager::unregisterAction(m_minimizeAction, Constants::MINIMIZE_WINDOW);
-        ActionManager::unregisterAction(m_zoomAction, Constants::ZOOM_WINDOW);
-        ActionManager::unregisterAction(m_closeAction, Constants::CLOSE_WINDOW);
+    if (!m_shutdown) { // don't update all that stuff if we are shutting down anyhow
+        if (UseMacShortcuts) {
+            ActionManager::unregisterAction(m_minimizeAction, Constants::MINIMIZE_WINDOW);
+            ActionManager::unregisterAction(m_zoomAction, Constants::ZOOM_WINDOW);
+            ActionManager::unregisterAction(m_closeAction, Constants::CLOSE_WINDOW);
+        }
+        ActionManager::unregisterAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN);
+        ICore::removeContextObject(m_contextObject);
+        WindowList::removeWindow(m_window);
     }
-    ActionManager::unregisterAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN);
-    ICore::removeContextObject(m_contextObject);
-    WindowList::removeWindow(m_window);
 }
 
 void WindowSupport::setCloseActionEnabled(bool enabled)
diff --git a/src/plugins/coreplugin/windowsupport.h b/src/plugins/coreplugin/windowsupport.h
index f33091cc923b0e44094cf5185e1e6168ad959241..2394ac5837950e61ed3a24aa2dab9b6bdfa2d0e3 100644
--- a/src/plugins/coreplugin/windowsupport.h
+++ b/src/plugins/coreplugin/windowsupport.h
@@ -85,6 +85,7 @@ private:
     QAction *m_zoomAction;
     QAction *m_closeAction;
     QAction *m_toggleFullScreenAction;
+    bool m_shutdown = false;
 };
 
 } // Internal