cleanup ivars() related globals on program termination

This commit is contained in:
rlar 2012-08-23 19:10:05 +02:00
parent f4ad29a17c
commit 84283b43d4
4 changed files with 8 additions and 5 deletions

View File

@ -15,6 +15,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "variable.h"
#include "plotting/graf.h"
#include "display.h"
#include "../misc/ivars.h"
#ifdef HAVE_GNUREADLINE
#include <readline/readline.h>
@ -73,6 +74,9 @@ com_quit(wordlist *wl)
DevSwitch(NULL);
/* then go away */
destroy_ivars();
byemesg();
exit(exitcode);
}

View File

@ -489,7 +489,7 @@ SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator)
static void
sp_shutdown(int exitval)
{
cleanvars();
destroy_ivars();
#ifdef PARALLEL_ARCH
{
Error("Fatal error in SPICE", -1);

View File

@ -109,13 +109,12 @@ ivars(char *argv0)
}
void
cleanvars(void)
destroy_ivars(void)
{
tfree(News_File);
tfree(Default_MFB_Cap);
tfree(Help_Path);
tfree(Lib_Path);
tfree(Spice_Path);
if (Inp_Path) /* may be NULL in LINUX */
tfree(Inp_Path);
tfree(Inp_Path);
}

View File

@ -8,6 +8,6 @@
void ivars(char*);
void cleanvars(void);
void destroy_ivars(void);
#endif