mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
don't free() manually buffered input ports
since they point to gc managed memory.
This commit is contained in:
parent
5d94079e4a
commit
e8b2cb872b
2 changed files with 4 additions and 3 deletions
6
eval.c
6
eval.c
|
@ -1971,9 +1971,11 @@ static sexp sexp_close_port (sexp ctx, sexp port) {
|
||||||
if (! sexp_port_openp(port))
|
if (! sexp_port_openp(port))
|
||||||
return sexp_user_exception(ctx, SEXP_FALSE, "port already closed", port);
|
return sexp_user_exception(ctx, SEXP_FALSE, "port already closed", port);
|
||||||
if (sexp_port_stream(port))
|
if (sexp_port_stream(port))
|
||||||
fclose(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));
|
free(sexp_port_buf(port));
|
||||||
|
#endif
|
||||||
sexp_port_openp(port) = 0;
|
sexp_port_openp(port) = 0;
|
||||||
return SEXP_VOID;
|
return SEXP_VOID;
|
||||||
}
|
}
|
||||||
|
|
1
gc.c
1
gc.c
|
@ -151,7 +151,6 @@ sexp sexp_sweep (sexp ctx, size_t *sum_freed_ptr) {
|
||||||
sexp sexp_gc (sexp ctx, size_t *sum_freed) {
|
sexp sexp_gc (sexp ctx, size_t *sum_freed) {
|
||||||
sexp res;
|
sexp res;
|
||||||
int i;
|
int i;
|
||||||
fprintf(stderr, "*********************** gc **********************\n");
|
|
||||||
sexp_mark(continuation_resumer);
|
sexp_mark(continuation_resumer);
|
||||||
sexp_mark(final_resumer);
|
sexp_mark(final_resumer);
|
||||||
for (i=0; i<SEXP_SYMBOL_TABLE_SIZE; i++)
|
for (i=0; i<SEXP_SYMBOL_TABLE_SIZE; i++)
|
||||||
|
|
Loading…
Add table
Reference in a new issue