aboutsummaryrefslogtreecommitdiff
path: root/base/plugins.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'base/plugins.cpp')
-rw-r--r--base/plugins.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp
index e881944a1b..ab09b26027 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -338,16 +338,20 @@ void PluginManager::loadNonEnginePluginsAndEnumerate() {
pp != _providers.end();
++pp) {
PluginList pl((*pp)->getPlugins());
+
for (PluginList::iterator p = pl.begin(); p != pl.end(); ++p) {
- // To find out which are engine plugins, we have to load them. This is inefficient
- // Hopefully another way can be found (e.g. if the music plugins are all static,
- // we can use only the static provider
- if ((*p)->loadPlugin()) {
+ // This is a 'hack' based on the assumption that we have no sound
+ // file plugins. Currently this is the case. If it changes, we
+ // should find a fast way of detecting whether a plugin is a
+ // music or an engine plugin.
+ if ((*pp)->isFilePluginProvider()) {
+ _allEnginePlugins.push_back(*p);
+ } else if ((*p)->loadPlugin()) { // and this is the proper method
if ((*p)->getType() == PLUGIN_TYPE_ENGINE) {
- (*p)->unloadPlugin(); // to prevent fragmentation
+ (*p)->unloadPlugin();
_allEnginePlugins.push_back(*p);
} else { // add non-engine plugins to the 'in-memory' list
- // these won't ever get unloaded (in this implementation)
+ // these won't ever get unloaded
addToPluginsInMemList(*p);
}
}