Gui, module menu: fix memleak

This commit is contained in:
SG 2023-04-18 15:56:41 +03:00 committed by MX
parent dd1a92803e
commit 8cfb37c12f
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83

View file

@ -154,6 +154,8 @@ Menu* menu_alloc() {
void menu_free(Menu* menu) { void menu_free(Menu* menu) {
furi_assert(menu); furi_assert(menu);
menu_reset(menu); menu_reset(menu);
with_view_model(
menu->view, MenuModel * model, { MenuItemArray_clear(model->items); }, false);
view_free(menu->view); view_free(menu->view);
free(menu); free(menu);
} }