From 6ee52ffd2ed7ba4a335f0d4a0aee059899a5a27d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Jun 2014 21:24:58 +0200 Subject: [PATCH] (Lakka) Goes over subitems now too to remove GL textures --- frontend/menu/disp/lakka.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/frontend/menu/disp/lakka.c b/frontend/menu/disp/lakka.c index efe0bc6bf5..ab88af3a36 100644 --- a/frontend/menu/disp/lakka.c +++ b/frontend/menu/disp/lakka.c @@ -900,7 +900,7 @@ static GLuint png_texture_load(const char * file_name, int * width, int * height static void lakka_context_destroy(void *data) { - int i, j; + int i, j, k; gl_t *gl = (gl_t*)driver.video_data; glDeleteTextures(1, &settings_icon); @@ -915,14 +915,28 @@ static void lakka_context_destroy(void *data) for (i = 1; i < num_categories; i++) { menu_category_t *category = (menu_category_t*)&categories[i]; + + if (!category) + continue; + glDeleteTextures(1, &category->icon); glDeleteTextures(1, &category->item_icon); - /*for (j = 0; j < category->num_items; j++) + for (j = 0; j < category->num_items; j++) { - menu_item_t *item = (menu_item_t*)&category->items[j]; - glDeleteTextures(1, &item->icon); - }*/ + menu_item_t *item; + menu_subitem_t *subitem; + + item = (menu_item_t*)&category->items[j]; + + if (item) + { + subitem = (menu_subitem_t*)&item->subitems[j]; + + if (subitem) + glDeleteTextures(1, &subitem->icon); + } + } } //if (numtweens)