Before we exit, explicitly call t_fcloseall() and make stdout

unbuffered to reduce noise in the malloc() statistics.
This commit is contained in:
Dag-Erling Smørgrav 2014-10-30 12:04:29 +00:00 committed by des
parent bf087fd70e
commit 277201a4bb

View file

@ -201,13 +201,15 @@ main(int argc, char *argv[])
} }
} }
/* clean up and exit */ /* clean up as much as possible before we exit */
t_cleanup(); t_cleanup();
t_fcloseall();
for (n = 0; n < t_plan_len; ++n) { for (n = 0; n < t_plan_len; ++n) {
free(t_plan[n]->desc); free(t_plan[n]->desc);
free(t_plan[n]); free(t_plan[n]);
} }
free(t_plan); free(t_plan);
setvbuf(stdout, NULL, _IONBF, 0);
if (verbose) if (verbose)
t_malloc_printstats(stderr); t_malloc_printstats(stderr);
exit(fail > 0 ? 1 : 0); exit(fail > 0 ? 1 : 0);