Now checks if locking the looper succeeded.
Now hides the window before removing itself to prevent a superfluous drawing update. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15410 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1056,12 +1056,20 @@ BMenu::_show(bool selectFirstItem)
|
||||
void
|
||||
BMenu::_hide()
|
||||
{
|
||||
if (fCachedMenuWindow != NULL) {
|
||||
fCachedMenuWindow->Lock();
|
||||
fCachedMenuWindow->ChildAt(0)->RemoveChild(this);
|
||||
fCachedMenuWindow->Quit();
|
||||
fCachedMenuWindow = NULL;
|
||||
if (!LockLooper())
|
||||
return;
|
||||
if (fCachedMenuWindow == NULL) {
|
||||
// Huh? What did happen here? - we're trying to be on the safe side
|
||||
UnlockLooper();
|
||||
return;
|
||||
}
|
||||
|
||||
fCachedMenuWindow->Hide();
|
||||
fCachedMenuWindow->ChildAt(0)->RemoveChild(this);
|
||||
// we don't want to be deleted when the window is removed
|
||||
|
||||
fCachedMenuWindow->Quit();
|
||||
fCachedMenuWindow = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user