don't free() manually buffered input ports

since they point to gc managed memory.
This commit is contained in:
Alex Shinn 2009-07-14 00:42:36 +09:00
parent 5d94079e4a
commit e8b2cb872b
2 changed files with 4 additions and 3 deletions

4
eval.c
View file

@ -1972,8 +1972,10 @@ static sexp sexp_close_port (sexp ctx, sexp port) {
return sexp_user_exception(ctx, SEXP_FALSE, "port already closed", port);
if (sexp_port_stream(port))
fclose(sexp_port_stream(port));
if (sexp_port_buf(port))
#if ! USE_STRING_STREAMS
if (sexp_port_buf(port) && sexp_oportp(port))
free(sexp_port_buf(port));
#endif
sexp_port_openp(port) = 0;
return SEXP_VOID;
}

1
gc.c
View file

@ -151,7 +151,6 @@ sexp sexp_sweep (sexp ctx, size_t *sum_freed_ptr) {
sexp sexp_gc (sexp ctx, size_t *sum_freed) {
sexp res;
int i;
fprintf(stderr, "*********************** gc **********************\n");
sexp_mark(continuation_resumer);
sexp_mark(final_resumer);
for (i=0; i<SEXP_SYMBOL_TABLE_SIZE; i++)