only lock after checking the other conditions. Also changed iteration

to remove menu items with a single RemoveItems() call. Axel, I hope you 
don't mind.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19600 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2006-12-22 07:34:05 +00:00
parent 9710088cc3
commit 6e194a72e7

View File

@ -81,9 +81,7 @@ TWindowMenu::AttachedToWindow()
{
SetFont(be_plain_font);
BMenuItem *item = NULL;
while ((item = RemoveItem((int32)0)) != NULL)
delete (item);
RemoveItems(0, CountItems(), true);
int32 miniCount = 0;
@ -212,12 +210,10 @@ TWindowMenu::DetachedFromWindow()
// in expando mode the teammenu will not call DragStop,
// thus, it needs to be called from here
TBarView *barview = (dynamic_cast<TBarApp*>(be_app))->BarView();
if (barview && barview->LockLooper()) {
if (barview->Expando() && barview->Dragging()) {
// We changed the show level in AttachedToWindow(). Undo it.
Window()->Show();
barview->DragStop();
}
if (barview && barview->Expando() && barview->Dragging() && barview->LockLooper()) {
// We changed the show level in AttachedToWindow(). Undo it.
Window()->Show();
barview->DragStop();
barview->UnlockLooper();
}