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:
@@ -1606,7 +1606,7 @@ BMenu::MenuWindow()
|
|||||||
if (fCachedMenuWindow == NULL) {
|
if (fCachedMenuWindow == NULL) {
|
||||||
char windowName[64];
|
char windowName[64];
|
||||||
snprintf(windowName, 64, "%s cached menu", Name());
|
snprintf(windowName, 64, "%s cached menu", Name());
|
||||||
fCachedMenuWindow = new BMenuWindow(windowName, this);
|
fCachedMenuWindow = new BMenuWindow(windowName, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return fCachedMenuWindow;
|
return fCachedMenuWindow;
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ BMenuWindow::BMenuWindow(const char *name, BMenu *menu)
|
|||||||
fUpperScroller(NULL),
|
fUpperScroller(NULL),
|
||||||
fLowerScroller(NULL)
|
fLowerScroller(NULL)
|
||||||
{
|
{
|
||||||
SetMenu(menu);
|
if (menu != NULL)
|
||||||
|
SetMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user