diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 16180a9358f..8fe9c0101a0 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -1411,18 +1411,6 @@ void PluginManagerPrivate::shutdown() } } -/*! - \internal -*/ -void PluginManagerPrivate::asyncShutdownFinished() -{ - auto *plugin = qobject_cast(sender()); - Q_ASSERT(plugin); - asynchronousPlugins.remove(plugin->pluginSpec()); - if (asynchronousPlugins.isEmpty()) - shutdownEventLoop->exit(); -} - /*! \internal */ @@ -1645,8 +1633,11 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt profilingReport(">stop", spec); if (spec->d->stop() == IPlugin::AsynchronousShutdown) { asynchronousPlugins << spec; - connect(spec->plugin(), &IPlugin::asynchronousShutdownFinished, - this, &PluginManagerPrivate::asyncShutdownFinished); + connect(spec->plugin(), &IPlugin::asynchronousShutdownFinished, this, [this, spec] { + asynchronousPlugins.remove(spec); + if (asynchronousPlugins.isEmpty()) + shutdownEventLoop->exit(); + }); } profilingReport("