Commit 6bfe5fa6 authored by Ghislain MARY's avatar Ghislain MARY

Unload mediastreamer2 plugins on ms_exit().

parent 4a919b63
......@@ -171,7 +171,7 @@ MS2_PUBLIC MSList *ms_list_copy(const MSList *list);
* Helper macro for backward compatibility.
* Use ms_base_exit() and ms_voip_exit() instead.
*/
#define ms_exit() ms_voip_exit(), ms_base_exit()
#define ms_exit() ms_plugins_exit(), ms_voip_exit(), ms_base_exit()
/**
......@@ -229,6 +229,11 @@ MS2_PUBLIC void ms_base_exit(void);
*/
MS2_PUBLIC void ms_voip_exit(void);
/**
* Unload the plugins loaded by ms_plugins_init().
*/
MS2_PUBLIC void ms_plugins_exit(void);
struct _MSSndCardDesc;
MS2_PUBLIC void ms_sleep(int seconds);
......
......@@ -280,18 +280,8 @@ int ms_load_plugins(const char *dir){
return ms_factory_load_plugins(ms_factory_get_fallback(),dir);
}
static int ms_plugins_ref=0;
void ms_unload_plugins(){
if (--ms_plugins_ref >0 ) {
ms_message ("Skiping ms_unload_plugins, still [%i] ref",ms_plugins_ref);
return;
}
ms_factory_uninit_plugins(ms_factory_get_fallback());
}
static int ms_base_ref=0;
static int ms_plugins_ref=0;
void ms_base_init(){
......@@ -318,6 +308,14 @@ void ms_plugins_init(void) {
ms_factory_init_plugins(ms_factory_get_fallback());
}
void ms_plugins_exit(void) {
if (--ms_plugins_ref >0 ) {
ms_message ("Skiping ms_plugins_exit, still [%i] ref",ms_plugins_ref);
return;
}
ms_factory_uninit_plugins(ms_factory_get_fallback());
}
void ms_set_plugins_dir(const char *path) {
ms_factory_set_plugins_dir(ms_factory_get_fallback(),path);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment