mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 07:18:40 +01:00
Tracker: Cleanup menu items better in DeleteSubmenu()
Change-Id: Ie0679393c208e8dcaf23f975ba3d9bd2d12bad12 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8228 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
This commit is contained in:
parent
84bdf57a71
commit
77fafacae3
@ -1433,17 +1433,12 @@ DeleteSubmenu(BMenuItem* submenuItem)
|
||||
if (submenuItem == NULL)
|
||||
return;
|
||||
|
||||
BMenu* menu = submenuItem->Submenu();
|
||||
if (menu == NULL)
|
||||
BMenu* submenu = submenuItem->Submenu();
|
||||
if (submenu == NULL)
|
||||
return;
|
||||
|
||||
for (;;) {
|
||||
BMenuItem* item = menu->RemoveItem((int32)0);
|
||||
if (item == NULL)
|
||||
return;
|
||||
|
||||
delete item;
|
||||
}
|
||||
// delete all submenu items
|
||||
submenu->RemoveItems(0, submenu->CountItems(), true);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user