From 5e0fd1bf16fe0821f9e4f7c521b92bf396a7968f Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 20 Oct 2012 12:43:41 +0200 Subject: [PATCH] to tabula-rasa --- src/frontend/misccoms.c | 61 ++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/src/frontend/misccoms.c b/src/frontend/misccoms.c index 3b8bb7715..05d709145 100644 --- a/src/frontend/misccoms.c +++ b/src/frontend/misccoms.c @@ -36,6 +36,35 @@ static void byemesg(void); static int confirm_quit(void); +void +tabula_rasa(void) +{ + wordlist all = { "all", NULL, NULL }; + wordlist star = { "*", NULL, NULL }; + + DevSwitch(NULL); + DevSwitch(NULL); + + com_remcirc(NULL); + com_destroy(&all); + com_unalias(&star); + com_undefine(&star); + + cp_remvar("history"); + cp_remvar("noglob"); + cp_remvar("brief"); + cp_remvar("sourcepath"); + cp_remvar("program"); + cp_remvar("prompt"); + + cp_destroy_keywords(); + destroy_ivars(); + + destroy_const_plot(); + spice_destroy_devices(); +} + + void com_quit(wordlist *wl) { @@ -55,25 +84,6 @@ com_quit(wordlist *wl) if (!noask && !confirm_quit()) return; - /* start to clean up the mess */ - - { - wordlist all = { "all", NULL, NULL }; - wordlist star = { "*", NULL, NULL }; - - com_remcirc(NULL); - com_destroy(&all); - com_unalias(&star); - com_undefine(&star); - - cp_remvar("history"); - cp_remvar("noglob"); - cp_remvar("brief"); - cp_remvar("sourcepath"); - cp_remvar("program"); - cp_remvar("prompt"); - } - #ifdef EXPERIMENTAL_CODE /* Destroy CKT when quit. Add by Gong Ding, gdiso@ustc.edu */ if (!ft_nutmeg) { @@ -84,17 +94,12 @@ com_quit(wordlist *wl) } #endif - DevSwitch(NULL); - DevSwitch(NULL); + byemesg(); + + /* clean up the mess */ + tabula_rasa(); /* then go away */ - - cp_destroy_keywords(); - destroy_ivars(); - - byemesg(); - destroy_const_plot(); - spice_destroy_devices(); exit(exitcode); }