void PluginRegistry::exit() { for( Plugins::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i) { Plugin* plugin = *i; plugin->exit(); delete plugin; } _plugins.clear(); }
void PluginFactory::destroyPlugin( const PluginInfoPair& pair ) { PluginInfo *pluginInfo = pair.first; Plugin *plugin = pluginInfo->get(); if( !plugin ) return; PTRACE( 6, "Exiting plugin... " << pluginInfo->name ); plugin->exit(); //remove plugin from the lists Plugin::Type type = pluginInfo->type; PluginList& list = pluginMap[ type ]; list.removeRef( plugin ); idMap.remove(pluginInfo->id); PTRACE( 6, "Destroying plugin" ); delete plugin; }