clear all variables upon 'quit'
This commit is contained in:
parent
05f3d21c3e
commit
8be33bb361
|
|
@ -10,6 +10,7 @@
|
|||
#include "com_unset.h"
|
||||
#include "variable.h"
|
||||
|
||||
/* clear variables (by name or all) */
|
||||
void
|
||||
com_unset(wordlist *wl)
|
||||
{
|
||||
|
|
@ -29,3 +30,12 @@ com_unset(wordlist *wl)
|
|||
wl = wl->wl_next;
|
||||
}
|
||||
}
|
||||
|
||||
/* clear all variables (called from com_quit) */
|
||||
void unset_all(void){
|
||||
struct variable *var, *nv;
|
||||
for (var = variables; var; var = nv) {
|
||||
nv = var->va_next;
|
||||
cp_remvar(var->va_name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,5 +8,6 @@
|
|||
#include "ngspice/wordlist.h"
|
||||
|
||||
void com_unset(wordlist *wl);
|
||||
void unset_all(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ com_quit(wordlist *wl)
|
|||
#ifdef SHARED_MODULE
|
||||
destroy_const_plot();
|
||||
spice_destroy_devices();
|
||||
unset_all();
|
||||
cp_resetcontrol(FALSE);
|
||||
/* add 1000 to notify that we exit from 'quit' */
|
||||
controlled_exit(1000 + exitcode);
|
||||
|
|
|
|||
Loading…
Reference in New Issue