Don't us atexit(), but delete memory during 'quit'

This commit is contained in:
Holger Vogt 2020-04-03 18:31:31 +02:00
parent c2513af3e8
commit c4e23989f3
2 changed files with 4 additions and 3 deletions

View File

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

View File

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