mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-12-06 12:43:35 +01:00
The context menu was created with Qt::WA_DeleteOnClose, but its actions open modal dialogs from within QMenu's own activation code. A nested event loop could process the menu's deferred deletion before control returned to QMenu, which then accessed freed memory, causing crashes or heap corruption. Own the menu with a std::unique_ptr so it is only destroyed once QMenu::exec has returned. Fixes https://bugs.dolphin-emu.org/issues/13816