Browse Source

cleanup ivars() related globals on program termination

rlar 14 years ago
parent
commit
84283b43d4
  1. 4
      src/frontend/misccoms.c
  2. 2
      src/main.c
  3. 5
      src/misc/ivars.c
  4. 2
      src/misc/ivars.h

4
src/frontend/misccoms.c

@ -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);
}

2
src/main.c

@ -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);

5
src/misc/ivars.c

@ -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);
}

2
src/misc/ivars.h

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