Changeset 4873 for branches/erijo-dev
- Timestamp:
- 03/20/07 05:38:00 (21 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/erijo-dev/licq/src/plugin/pluginrepository.cpp
r4869 r4873 40 40 void Licq::TPluginRepository::rebuildCache() 41 41 { 42 // Remove all old factories 43 PluginFactories.clear(); 42 TPluginFactories factories; 44 43 45 44 for (TStringList::const_iterator path = PluginPaths.begin(); 46 45 path != PluginPaths.end(); ++path) 47 46 { 48 const unsigned int count = PluginLoader.loadPlugins(*path, & PluginFactories);47 const unsigned int count = PluginLoader.loadPlugins(*path, &factories); 49 48 Log->debug("Loaded %u plugin%s from %s", 50 49 count, (count == 1 ? "" : "s"), path->c_str()); 51 50 } 52 51 53 // Clear the cache 52 // Remove old factories and clear cache 53 PluginFactories.clear(); 54 54 std::for_each(PluginCache.begin(), PluginCache.end(), ObjectDeleter()); 55 55 56 for (TPluginFactories::const_iterator factory = PluginFactories.begin();57 factory != PluginFactories.end(); ++factory)56 for (TPluginFactories::const_iterator factory = factories.begin(); 57 factory != factories.end(); ++factory) 58 58 { 59 bool factorySaved = false; 59 60 const unsigned int count = (*factory)->getPluginCount(); 60 61 for (unsigned int index = 0; index < count; ++index) … … 83 84 } 84 85 86 // Save factory if it hasn't already been saved. 87 if (!factorySaved) 88 { 89 PluginFactories.push_back(*factory); 90 factorySaved = true; 91 } 92 93 // Cache plugin 85 94 PluginCache[entry->Information.Name] = entry; 86 95 }
