Skip to content

Commit

Permalink
fix infinite loop with null menu driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Parker committed Jan 7, 2019
1 parent d25b632 commit 459a19b
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions menu/drivers/null.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,54 @@

#include "../menu_driver.h"

static bool g_menu_on = false;

static void* null_init(void **userdata, bool video_is_threaded)
{
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));

if (!menu)
return NULL;

return menu;
}

static void null_free(void *data)
{
menu_handle_t *menu = (menu_handle_t*)data;

/*if (menu)
free(menu);*/
}

static void null_toggle(void *userdata, bool menu_on)
{
(void)userdata;

g_menu_on = menu_on;
}

static int null_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_action action)
{
(void)menu;
(void)userdata;
(void)action;

return 1;
}

menu_ctx_driver_t menu_ctx_null = {
NULL, /* set_texture */
NULL, /* render_messagebox */
NULL, /* iterate */
null_menu_iterate,
NULL, /* render */
NULL, /* frame */
NULL, /* init */
NULL, /* free */
null_init,
null_free,
NULL, /* context_reset */
NULL, /* context_destroy */
NULL, /* populate_entries */
NULL, /* toggle */
null_toggle,
NULL, /* navigation_clear */
NULL, /* navigation_decrement */
NULL, /* navigation_increment */
Expand Down

0 comments on commit 459a19b

Please sign in to comment.