Avoid tracking the menubar if it's tracking already

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16974 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2006-04-02 21:47:46 +00:00
parent 290026d3b1
commit a2b0a7ac3e

View File

@ -298,6 +298,9 @@ BMenuBar::operator=(const BMenuBar &)
void
BMenuBar::StartMenuBar(int32 menuIndex, bool sticky, bool showMenu, BRect *specialRect)
{
if (fTracking)
return;
BWindow *window = Window();
if (window == NULL)
debugger("MenuBar must be added to a window before it can be used.");
@ -329,6 +332,7 @@ BMenuBar::StartMenuBar(int32 menuIndex, bool sticky, bool showMenu, BRect *speci
send_data(fTrackingPID, 0, &data, sizeof(data));
} else {
fTracking = false;
_set_menu_sem_(window, B_NO_MORE_SEMS);
delete_sem(fMenuSem);
}