From 456252582ec85932a0f8b96e44627f45f4c39b81 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 4 Dec 2015 03:26:48 +0100 Subject: [PATCH] (menu_navigation.c) Turn static variable into local static variable --- menu/menu_navigation.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/menu/menu_navigation.c b/menu/menu_navigation.c index 744747c44c..5295766337 100644 --- a/menu/menu_navigation.c +++ b/menu/menu_navigation.c @@ -46,10 +46,10 @@ typedef struct menu_navigation size_t selection_ptr; } menu_navigation_t; -static menu_navigation_t menu_navigation_state; static menu_navigation_t *menu_navigation_get_ptr(void) { + static menu_navigation_t menu_navigation_state; return &menu_navigation_state; } @@ -268,5 +268,6 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data) void menu_navigation_free(void) { - memset(&menu_navigation_state, 0, sizeof(menu_navigation_t)); + menu_navigation_t *nav = menu_navigation_get_ptr(); + memset(nav, 0, sizeof(menu_navigation_t)); }