Lock the root menu before calling BMenuItem::Invoke(). This fixes #3842, although in some circumstances could introduce a deadlock (if someone does strange things in Invoke(), for example).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30662 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a48d16a026
commit
c6278c8f49
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user