be sure to reinitialise IO after Restore.

This commit is contained in:
Vítor Santos Costa 2011-04-04 14:36:06 +01:00
parent 7463cbea96
commit fb6b44a96e

View File

@ -1762,6 +1762,9 @@ Restore(char *s, char *lib_dir USES_REGS)
} }
Yap_ReOpenLoadForeign(); Yap_ReOpenLoadForeign();
FreeRecords();
/* restart IO */
initIO();
/* reset time */ /* reset time */
Yap_ReInitWallTime(); Yap_ReInitWallTime();
Yap_InitSysPath(); Yap_InitSysPath();
@ -1770,7 +1773,6 @@ Restore(char *s, char *lib_dir USES_REGS)
Yap_InitPreAllocCodeSpace(); Yap_InitPreAllocCodeSpace();
} }
#endif #endif
FreeRecords();
CloseRestore(); CloseRestore();
if (which_save == 2) { if (which_save == 2) {
Yap_unify(ARG2, MkIntTerm(0)); Yap_unify(ARG2, MkIntTerm(0));