From bbf18f5a6661e07d76db26139611eb89bd02f05c Mon Sep 17 00:00:00 2001 From: Allanis Date: Sat, 8 Mar 2014 01:46:24 +0000 Subject: [PATCH] [Fix] Close the info panel if it's open on exit. --- src/menu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/menu.c b/src/menu.c index 73f2252..6c08428 100644 --- a/src/menu.c +++ b/src/menu.c @@ -229,6 +229,7 @@ static void menu_small_close(unsigned int wid, char* str) { */ static void menu_small_exit(unsigned int wid, char* str) { (void)str; + unsigned int info_wid; /* If landed we must save anyway. */ if(landed) { @@ -238,6 +239,13 @@ static void menu_small_exit(unsigned int wid, char* str) { land_cleanup(); } + /* Close info menu if open. */ + if(menu_isOpen(MENU_INFO)) { + info_wid = window_get("Info"); + window_destroy(info_wid); + menu_Close(MENU_INFO); + } + window_destroy(wid); menu_Close(MENU_SMALL); menu_main();