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
|
void
|
||||||
BMenu::_hide()
|
BMenu::_hide()
|
||||||
{
|
{
|
||||||
if (fCachedMenuWindow != NULL) {
|
if (!LockLooper())
|
||||||
fCachedMenuWindow->Lock();
|
return;
|
||||||
fCachedMenuWindow->ChildAt(0)->RemoveChild(this);
|
if (fCachedMenuWindow == NULL) {
|
||||||
fCachedMenuWindow->Quit();
|
// Huh? What did happen here? - we're trying to be on the safe side
|
||||||
fCachedMenuWindow = NULL;
|
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