I woulnd't say the classical last words... but I seem to have fixed latest crashes...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16943 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+19
-24
@@ -1120,13 +1120,10 @@ BMenu::_hide()
|
|||||||
// Delete the menu window used by our submenus
|
// Delete the menu window used by our submenus
|
||||||
DeleteMenuWindow();
|
DeleteMenuWindow();
|
||||||
|
|
||||||
if (Supermenu() == NULL) {
|
|
||||||
// It's our window. Quit it.
|
|
||||||
window->Quit();
|
|
||||||
} else {
|
|
||||||
// _show() expects the window to be unlocked
|
|
||||||
window->Unlock();
|
window->Unlock();
|
||||||
}
|
|
||||||
|
if (fSuper == NULL && window->Lock())
|
||||||
|
window->Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1226,32 +1223,30 @@ BMenu::_AddItem(BMenuItem *item, int32 index)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->SetSuper(this);
|
// install the item on the supermenu's window
|
||||||
|
// or onto our window, if we are a root menu
|
||||||
// Make sure we update the layout in case we are already attached.
|
BWindow* window = NULL;
|
||||||
if (fResizeToFit && locked && Window() != NULL /*&& !Window()->IsHidden()*/) {
|
if (Superitem() != NULL)
|
||||||
LayoutItems(index);
|
window = Superitem()->fWindow;
|
||||||
//UpdateWindowViewSize();
|
else
|
||||||
Invalidate();
|
window = Window();
|
||||||
}
|
|
||||||
|
|
||||||
// Find the root menu window, so we can install this item.
|
|
||||||
// ToDo: this shouldn't be necessary - the first supermenu is
|
|
||||||
// already initialized to the same window
|
|
||||||
BMenu* root = this;
|
|
||||||
while (root->Supermenu())
|
|
||||||
root = root->Supermenu();
|
|
||||||
|
|
||||||
BWindow* window = root->Window();
|
|
||||||
|
|
||||||
if (locked)
|
if (locked)
|
||||||
UnlockLooper();
|
UnlockLooper();
|
||||||
|
|
||||||
|
item->SetSuper(this);
|
||||||
|
|
||||||
// if we need to install the item in another window, we don't
|
// if we need to install the item in another window, we don't
|
||||||
// want to keep our lock to prevent deadlocks
|
// want to keep our lock to prevent deadlocks
|
||||||
|
|
||||||
if (window && window->Lock()) {
|
if (window && window->Lock()) {
|
||||||
item->Install(window);
|
item->Install(window);
|
||||||
|
|
||||||
|
// Make sure we update the layout if needed.
|
||||||
|
if (fResizeToFit) {
|
||||||
|
LayoutItems(index);
|
||||||
|
//UpdateWindowViewSize();
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
window->Unlock();
|
window->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user