mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 09:20:16 +01:00
Complementary un-registration of providers; change function name
This commit is contained in:
@@ -182,13 +182,23 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterBuiltinModule(ModuleMain moduleMain)
|
||||
void RegisterProvider(ModuleMain moduleMain)
|
||||
{
|
||||
builtinModuleList().push_back(moduleMain);
|
||||
auto &list = builtinModuleList();
|
||||
if ( moduleMain )
|
||||
list.push_back(moduleMain);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void UnregisterProvider(ModuleMain moduleMain)
|
||||
{
|
||||
auto &list = builtinModuleList();
|
||||
auto end = list.end(), iter = std::find(list.begin(), end, moduleMain);
|
||||
if (iter != end)
|
||||
list.erase(iter);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Creation/Destruction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -136,6 +136,13 @@ private:
|
||||
using ModuleMain = ModuleInterface *(*)(const wxString *path);
|
||||
|
||||
AUDACITY_DLL_API
|
||||
void RegisterBuiltinModule(ModuleMain rtn);
|
||||
void RegisterProvider(ModuleMain rtn);
|
||||
AUDACITY_DLL_API
|
||||
void UnregisterProvider(ModuleMain rtn);
|
||||
|
||||
// Guarantee the registry exists before any registrations, so it will
|
||||
// be destroyed only after the un-registrations
|
||||
static struct Init{
|
||||
Init() { RegisterProvider(nullptr); } } sInitBuiltinModules;
|
||||
|
||||
#endif /* __AUDACITY_MODULEMANAGER_H__ */
|
||||
|
||||
Reference in New Issue
Block a user