mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-04 17:49:45 +02:00
Don't crash on exit when a module attaches a menu item...
... such as Nyquist Workbench. I don't fully understand why, but destroying the menu registry items very late, during the destruction of static objects, causes a crash in memory deallocation, at least on Mac. So destroy the menu registry explicitly in application shut-down.
This commit is contained in:
parent
77abcf1579
commit
e5540c6118
@ -2140,6 +2140,8 @@ int AudacityApp::OnExit()
|
|||||||
|
|
||||||
AudioIO::Deinit();
|
AudioIO::Deinit();
|
||||||
|
|
||||||
|
MenuTable::DestroyRegistry();
|
||||||
|
|
||||||
// Terminate the PluginManager (must be done before deleting the locale)
|
// Terminate the PluginManager (must be done before deleting the locale)
|
||||||
PluginManager::Get().Terminate();
|
PluginManager::Get().Terminate();
|
||||||
|
|
||||||
|
@ -1059,6 +1059,11 @@ MenuTable::AttachedItem::AttachedItem(
|
|||||||
Registry::RegisterItem( sRegistry(), placement, std::move( pItem ) );
|
Registry::RegisterItem( sRegistry(), placement, std::move( pItem ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MenuTable::DestroyRegistry()
|
||||||
|
{
|
||||||
|
sRegistry().items.clear();
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace MenuTable;
|
using namespace MenuTable;
|
||||||
|
@ -992,6 +992,8 @@ namespace MenuTable {
|
|||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void DestroyRegistry();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user