mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
Added proper shutdown of the plugins with remove of the service and dlcose of the plugin handle.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8493 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bfab3622ec
commit
5f4e465a09
8 changed files with 49 additions and 19 deletions
|
@ -174,7 +174,7 @@ void RsPluginManager::loadPlugins(const std::vector<std::string>& plugin_directo
|
|||
saveConfiguration();
|
||||
}
|
||||
|
||||
void RsPluginManager::stopPlugins()
|
||||
void RsPluginManager::stopPlugins(p3ServiceServer *pqih)
|
||||
{
|
||||
std::cerr << " Stopping plugins." << std::endl;
|
||||
|
||||
|
@ -182,16 +182,21 @@ void RsPluginManager::stopPlugins()
|
|||
{
|
||||
if (_plugins[i].plugin != NULL)
|
||||
{
|
||||
p3Service *service = _plugins[i].plugin->p3_service();
|
||||
if (service)
|
||||
{
|
||||
pqih->removeService(service);
|
||||
}
|
||||
|
||||
_plugins[i].plugin->stop();
|
||||
// delete _plugins[i].plugin;
|
||||
// _plugins[i].plugin = NULL;
|
||||
delete _plugins[i].plugin;
|
||||
_plugins[i].plugin = NULL;
|
||||
}
|
||||
if (_plugins[i].handle)
|
||||
{
|
||||
dlclose(_plugins[i].handle);
|
||||
_plugins[i].handle = NULL;
|
||||
}
|
||||
// Causes a crash
|
||||
// if (_plugins[i].handle)
|
||||
// {
|
||||
// dlclose(_plugins[i].handle);
|
||||
// _plugins[i].handle = NULL;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ class RsPluginManager: public RsPluginHandler, public p3Config
|
|||
//
|
||||
void loadPlugins(const std::vector<RsPlugin*>& explicit_plugin_entries) ;
|
||||
|
||||
void stopPlugins();
|
||||
void stopPlugins(p3ServiceServer *pqih);
|
||||
|
||||
void registerCacheServices() ;
|
||||
void registerClientServices(p3ServiceServer *pqih) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue