(Menu) Cleanups

This commit is contained in:
Twinaphex 2015-06-11 21:12:08 +02:00
parent 2b1fe2de5d
commit c607915ef8
2 changed files with 16 additions and 4 deletions

View File

@ -527,6 +527,7 @@ static void glui_free(void *data)
if (menu->userdata)
free(menu->userdata);
menu->userdata = NULL;
}
static void glui_context_bg_destroy(glui_handle_t *glui)

View File

@ -1552,14 +1552,18 @@ static void *xmb_init(void)
error:
if (menu)
free(menu);
if (xmb)
{
if (xmb->menu_stack_old)
free(xmb->menu_stack_old);
xmb->menu_stack_old = NULL;
if (xmb->selection_buf_old)
free(xmb->selection_buf_old);
xmb->selection_buf_old = NULL;
if (xmb->horizontal_list)
free(xmb->horizontal_list);
xmb->horizontal_list = NULL;
}
return NULL;
}
@ -1579,13 +1583,20 @@ static void xmb_free(void *data)
if (!xmb)
return;
free(xmb->menu_stack_old);
free(xmb->selection_buf_old);
free(xmb->horizontal_list);
if (xmb->menu_stack_old)
free(xmb->menu_stack_old);
xmb->menu_stack_old = NULL;
if (xmb->selection_buf_old)
free(xmb->selection_buf_old);
xmb->selection_buf_old = NULL;
if (xmb->horizontal_list)
free(xmb->horizontal_list);
xmb->horizontal_list = NULL;
gl_coord_array_free(&xmb->raster_block.carr);
free(menu->userdata);
if (menu->userdata)
free(menu->userdata);
menu->userdata = NULL;
}