diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 61cdb7ff6f..7c4b07c825 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -2279,7 +2279,18 @@ BMenu::_InvokeItem(BMenuItem *item, bool now) UnlockLooper(); } - item->Invoke(); + // Lock the root menu window before calling BMenuItem::Invoke() + BMenu *parent = this; + BMenu *rootMenu = NULL; + do { + rootMenu = parent; + parent = rootMenu->Supermenu(); + } while (parent != NULL); + + if (rootMenu->LockLooper()) { + item->Invoke(); + rootMenu->UnlockLooper(); + } }