1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-23 06:23:49 +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:
Paul Licameli
2020-02-17 16:06:22 -05:00
parent 77abcf1579
commit e5540c6118
3 changed files with 9 additions and 0 deletions

View File

@@ -1059,6 +1059,11 @@ MenuTable::AttachedItem::AttachedItem(
Registry::RegisterItem( sRegistry(), placement, std::move( pItem ) );
}
void MenuTable::DestroyRegistry()
{
sRegistry().items.clear();
}
namespace {
using namespace MenuTable;