close streams on exit, so that we can flush the buffers

This commit is contained in:
Vitor Santos Costa 2012-08-02 09:59:57 -05:00
parent adef8d4737
commit a8f0beb64b
1 changed files with 2 additions and 0 deletions

2
C/init.c Normal file → Executable file
View File

@ -1368,6 +1368,7 @@ void
Yap_exit (int value)
{
CACHE_REGS
void closeFiles(int all);
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
Yap_unmap_yapor_memory();
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
@ -1383,6 +1384,7 @@ Yap_exit (int value)
run_halt_hooks(value);
Yap_ShutdownLoadForeign();
}
closeFiles(TRUE);
exit(value);
}