Avoid attaching a menu to the BMenuWindow when not needed

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16863 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-03-22 21:07:35 +00:00
parent b781587aff
commit 37cf3d970d
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1606,7 +1606,7 @@ BMenu::MenuWindow()
if (fCachedMenuWindow == NULL) {
char windowName[64];
snprintf(windowName, 64, "%s cached menu", Name());
fCachedMenuWindow = new BMenuWindow(windowName, this);
fCachedMenuWindow = new BMenuWindow(windowName, NULL);
}
return fCachedMenuWindow;
+2 -1
View File
@@ -38,7 +38,8 @@ BMenuWindow::BMenuWindow(const char *name, BMenu *menu)
fUpperScroller(NULL),
fLowerScroller(NULL)
{
SetMenu(menu);
if (menu != NULL)
SetMenu(menu);
}