From c21c04d73b640fc34bde8f4d15aa655b4f06ee46 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 11 Dec 2015 11:57:43 +0100 Subject: [PATCH] Create MENU_NAVIGATION_CTL_DEINIT --- menu/menu_driver.c | 2 +- menu/menu_navigation.c | 9 +++------ menu/menu_navigation.h | 3 +-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 390387785b..f80fe1be0a 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -544,7 +544,7 @@ void menu_free(menu_handle_t *menu) menu_shader_free(menu); menu_input_ctl(MENU_INPUT_CTL_DEINIT, NULL); - menu_navigation_free(); + menu_navigation_ctl(MENU_NAVIGATION_CTL_DEINIT, NULL); menu_driver_free(menu); menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_DEINIT, NULL); diff --git a/menu/menu_navigation.c b/menu/menu_navigation.c index b40170ce70..fc7ef707c3 100644 --- a/menu/menu_navigation.c +++ b/menu/menu_navigation.c @@ -67,6 +67,9 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data) switch (state) { + case MENU_NAVIGATION_CTL_DEINIT: + memset(nav, 0, sizeof(menu_navigation_t)); + break; case MENU_NAVIGATION_CTL_CLEAR: { size_t idx = 0; @@ -266,9 +269,3 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data) return false; } - -void menu_navigation_free(void) -{ - menu_navigation_t *nav = menu_navigation_get_ptr(); - memset(nav, 0, sizeof(menu_navigation_t)); -} diff --git a/menu/menu_navigation.h b/menu/menu_navigation.h index 29c896946a..6b96ae2c02 100644 --- a/menu/menu_navigation.h +++ b/menu/menu_navigation.h @@ -26,6 +26,7 @@ extern "C" { enum menu_navigation_ctl_state { MENU_NAVIGATION_CTL_CLEAR = 0, + MENU_NAVIGATION_CTL_DEINIT, MENU_NAVIGATION_CTL_INCREMENT, MENU_NAVIGATION_CTL_DECREMENT, MENU_NAVIGATION_CTL_SET, @@ -42,8 +43,6 @@ enum menu_navigation_ctl_state bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data); -void menu_navigation_free(void); - #ifdef __cplusplus } #endif