menu: ensure all addMenu() calls are followed with setParent() calls

Ensures memory taken by creating a new menu is freed.
This commit is contained in:
itsmattkc
2020-04-19 01:26:54 +10:00
parent 0c88a146c1
commit f2bff5f150
4 changed files with 99 additions and 64 deletions
+1
View File
@@ -99,6 +99,7 @@ Menu *NodeFactory::CreateMenu()
// Create menu here if it doesn't exist
if (!found_cat) {
Menu* new_category = new Menu(dir_name);
new_category->setParent(destination);
destination->InsertAlphabetically(new_category);
destination = new_category;
}