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:
@@ -2279,7 +2279,18 @@ BMenu::_InvokeItem(BMenuItem *item, bool now)
|
|||||||
UnlockLooper();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user