Don't us atexit(), but delete memory during 'quit'
This commit is contained in:
parent
c2513af3e8
commit
c4e23989f3
|
|
@ -34,6 +34,7 @@ extern char history_file[];
|
|||
|
||||
#ifdef SHARED_MODULE
|
||||
extern void rem_controls(void);
|
||||
extern void destroy_wallace(void);
|
||||
#endif
|
||||
|
||||
extern IFsimulator SIMinfo;
|
||||
|
|
@ -80,6 +81,8 @@ com_quit(wordlist *wl)
|
|||
cp_remvar("sourcepath");
|
||||
cp_remvar("program");
|
||||
cp_remvar("prompt");
|
||||
|
||||
destroy_wallace();
|
||||
}
|
||||
|
||||
rem_controls();
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ PolarGauss(double* py1, double* py2)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
void
|
||||
destroy_wallace(void)
|
||||
{
|
||||
tfree(pool1);
|
||||
|
|
@ -93,8 +93,6 @@ initw(void)
|
|||
addrif = TMALLOC(unsigned int, (n + NOTRANS));
|
||||
addrib = TMALLOC(unsigned int, (n + NOTRANS));
|
||||
|
||||
atexit(destroy_wallace);
|
||||
|
||||
/* fill the first pool with normally distributed values */
|
||||
PolarGauss(&pool1[0], &pool1[1]);
|
||||
for (i = 1; i < n>>1; i++)
|
||||
|
|
|
|||
Loading…
Reference in New Issue