DirMenu.cpp: fix memory leak.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Fixes #13118.
This commit is contained in:
parent
76c469dbcf
commit
4ad2ad6d84
|
@ -95,10 +95,12 @@ BDirMenu::Populate(const BEntry* startEntry, BWindow* originatingWindow,
|
|||
Model model(startEntry);
|
||||
ThrowOnInitCheckError(&model);
|
||||
|
||||
ModelMenuItem* menu = new ModelMenuItem(&model, this, true, true);
|
||||
ModelMenuItem* menu = NULL;
|
||||
|
||||
if (fMenuBar)
|
||||
if (fMenuBar) {
|
||||
menu = new ModelMenuItem(&model, this, true, true);
|
||||
fMenuBar->AddItem(menu);
|
||||
}
|
||||
|
||||
BEntry entry(*startEntry);
|
||||
|
||||
|
|
Loading…
Reference in New Issue