From 20cf7b184093cbca7940da1978170ec892d6cfe6 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sat, 17 Oct 2020 23:04:59 -0700 Subject: [PATCH] Fixed command-line launch segfault custom_menu_destroy() was causing a segfault when launching the game via command-line parameters --- developer/network.sh | 4 ++-- src/menu/custom_menu.c | 1 - src/menu/custom_menu_system.c | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/developer/network.sh b/developer/network.sh index 59c3a63c..0edcbd2a 100644 --- a/developer/network.sh +++ b/developer/network.sh @@ -30,11 +30,11 @@ fi # debug on client # ################### -$FILE --server 27015 --configfile sm64config_server.txt & +$FILE --server 27015 --configfile sm64config_server.txt & # debug if cgdb exists if ! [ -x "$(command -v cgdb)" ]; then - $FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt & + $FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt & else winpty cgdb $FILE -ex 'break debug_breakpoint_here' -ex 'run --client 127.0.0.1 27015 --configfile sm64config_client.txt' -ex 'quit' fi diff --git a/src/menu/custom_menu.c b/src/menu/custom_menu.c index 987bf720..31774403 100644 --- a/src/menu/custom_menu.c +++ b/src/menu/custom_menu.c @@ -295,7 +295,6 @@ void custom_menu_loop(void) { if (sGotoGame) { sSelectedFileNum = sGotoGame; custom_menu_close_system(); - custom_menu_destroy(); } // force-start the load when command-line server hosting diff --git a/src/menu/custom_menu_system.c b/src/menu/custom_menu_system.c index e1344bb5..796f8e40 100644 --- a/src/menu/custom_menu_system.c +++ b/src/menu/custom_menu_system.c @@ -97,9 +97,6 @@ void custom_menu_system_init(void) { void custom_menu_destroy(void) { // TODO: clean up all of the calloc()'d memory - sHead = NULL; - sCurrentMenu = NULL; - sLastMenu = NULL; } void custom_menu_system_loop(void) {