void ms_plugins_exit(void) { --ms_plugins_ref; 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()); }
/** * Destroy the factory. * This should be done after destroying all objects created by the factory. **/ void ms_factory_destroy(MSFactory *factory){ ms_factory_uninit_plugins(factory); if (factory->evq) ms_event_queue_destroy(factory->evq); factory->formats=ms_list_free_with_data(factory->formats,(void(*)(void*))ms_fmt_descriptor_destroy); factory->desc_list=ms_list_free(factory->desc_list); ms_list_for_each(factory->stats_list,ms_free); factory->stats_list=ms_list_free(factory->stats_list); ms_list_for_each(factory->platform_tags, ms_free); factory->platform_tags = ms_list_free(factory->platform_tags); if (factory->plugins_dir) ms_free(factory->plugins_dir); ms_free(factory); if (factory==fallback_factory) fallback_factory=NULL; }