1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 08:29:27 +02:00

Fix part 2 of bug #857

Gale found that the previous fix for bug #857 didn't
completely address all crashes.

In this case, the sequence of events:

1)  Dynamic module is added to list of module using its name, "VST Effects"
2)  Language is set (during init) to one that has "VST Effects" translated
3)  Language is changed to something else via preferences, which changes
    translation of "VST Effects" to something else.
4)  During termination, the module is deleted, but since the language
    has now changed due to translation, it isn't deleted from the list
    of modules
5)  An attempt is made to delete the next module, which happens to be
    the same one becuase it was never removed from the list.
6)  Boom...
This commit is contained in:
lllucius@gmail.com 2015-02-14 17:14:23 +00:00
parent 8ba320237f
commit 5d1dc4ce6a

View File

@ -215,6 +215,9 @@ ModuleManager::~ModuleManager()
while (iter != mDynModules.end())
{
UnloadModule(iter->second);
mDynModules.erase(iter->first);
iter = mDynModules.begin();
}
@ -481,14 +484,10 @@ void ModuleManager::UnloadModule(ModuleInterface *module)
{
if (module)
{
PluginID modID = PluginManager::GetID(module);
module->Terminate();
delete module;
mDynModules.erase(modID);
if (mLibs.find(module) != mLibs.end())
{
mLibs[module]->Unload();