From ba6cd9d80544abaad6d65d58cb7b6cfc4f979767 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 20 Jun 2021 20:41:52 +0000 Subject: fixed plugin cache cleanup git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@10079 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmp/abstractengine.cpp | 1 + src/qmmp/effect.cpp | 1 + src/qmmp/effect.h | 2 +- src/qmmp/inputsource.cpp | 1 + src/qmmp/metadatamanager.cpp | 5 ++++- src/qmmp/output.cpp | 1 + src/qmmp/qmmpplugincache.cpp | 3 +++ 7 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qmmp/abstractengine.cpp b/src/qmmp/abstractengine.cpp index cb3656b48..1f54aa952 100644 --- a/src/qmmp/abstractengine.cpp +++ b/src/qmmp/abstractengine.cpp @@ -64,6 +64,7 @@ void AbstractEngine::loadPlugins() m_cache->append(item); } m_disabledNames = settings.value("Engine/disabled_plugins").toStringList(); + QmmpPluginCache::cleanup(&settings); } AbstractEngine *AbstractEngine::create(InputSource *s, QObject *parent) diff --git a/src/qmmp/effect.cpp b/src/qmmp/effect.cpp index 8b45905b6..d058f30d7 100644 --- a/src/qmmp/effect.cpp +++ b/src/qmmp/effect.cpp @@ -165,6 +165,7 @@ void Effect::setEnabled(EffectFactory *factory, bool enable) QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Effect/enabled_plugins", m_enabledNames); + QmmpPluginCache::cleanup(&settings); } bool Effect::isEnabled(const EffectFactory *factory) diff --git a/src/qmmp/effect.h b/src/qmmp/effect.h index 000ca82ff..0ea883c30 100644 --- a/src/qmmp/effect.h +++ b/src/qmmp/effect.h @@ -66,7 +66,7 @@ public: /*! * Returns map of channels */ - const ChannelMap channelMap() const; + const ChannelMap channelMap() const; /*! * Returns audio parameters for output data. */ diff --git a/src/qmmp/inputsource.cpp b/src/qmmp/inputsource.cpp index 0edb2e144..ead3e183a 100644 --- a/src/qmmp/inputsource.cpp +++ b/src/qmmp/inputsource.cpp @@ -279,4 +279,5 @@ void InputSource::loadPlugins() m_cache->append(item); } m_disabledNames = settings.value("Transports/disabled_plugins").toStringList(); + QmmpPluginCache::cleanup(&settings); } diff --git a/src/qmmp/metadatamanager.cpp b/src/qmmp/metadatamanager.cpp index 55881e1bd..d5f877758 100644 --- a/src/qmmp/metadatamanager.cpp +++ b/src/qmmp/metadatamanager.cpp @@ -300,7 +300,10 @@ void MetaDataManager::clearCoverCache() void MetaDataManager::prepareForAnotherThread() { - protocols(); //this hack should load all required plugins + //this hack should load all required plugins + InputSource::enabledFactories(); + Decoder::enabledFactories(); + AbstractEngine::enabledFactories(); } bool MetaDataManager::hasMatch(const QList ®Exps, const QString &path) diff --git a/src/qmmp/output.cpp b/src/qmmp/output.cpp index d6255ba3e..6d633633c 100644 --- a/src/qmmp/output.cpp +++ b/src/qmmp/output.cpp @@ -89,6 +89,7 @@ void Output::loadPlugins() } m_cache->append(item); } + QmmpPluginCache::cleanup(&settings); } Output *Output::create () diff --git a/src/qmmp/qmmpplugincache.cpp b/src/qmmp/qmmpplugincache.cpp index 764d783db..bbacb1c4c 100644 --- a/src/qmmp/qmmpplugincache.cpp +++ b/src/qmmp/qmmpplugincache.cpp @@ -221,6 +221,9 @@ QObject *QmmpPluginCache::instance() else { m_error = true; + m_filters.clear(); + m_contentTypes.clear(); + m_protocols.clear(); qWarning("QmmpPluginCache: error: %s", qPrintable(loader.errorString ())); } return m_instance; -- cgit v1.2.3-13-gbd6f