summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-03-02 13:46:30 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-03-02 13:46:30 -0800
commitd0816a8d75c4d620d3f9868be45f3a7707ad24b2 (patch)
tree65c237c7cec187813f368eb37613a42426fabbfe /stream.c
parent684c8e9d60812778b785ef0fc3fa78592f228bf8 (diff)
downloadtxr-d0816a8d75c4d620d3f9868be45f3a7707ad24b2.tar.gz
txr-d0816a8d75c4d620d3f9868be45f3a7707ad24b2.tar.bz2
txr-d0816a8d75c4d620d3f9868be45f3a7707ad24b2.zip
Bugfix: catenated stream objects not hooked into garbage collector,
causing premature collection of the catenated stream list. * stream.c (cat_mark): new function. (cat_stream_ops): use cat_mark for gc mark function.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index d80c87c7..3a3d2d77 100644
--- a/stream.c
+++ b/stream.c
@@ -2336,11 +2336,17 @@ static val cat_get_prop(val stream, val ind)
return nil;
}
+static void cat_mark(val stream)
+{
+ val obj = (val) stream->co.handle;
+ gc_mark(obj);
+}
+
static struct strm_ops cat_stream_ops = {
{ eq,
cat_stream_print,
cobj_destroy_stub_op,
- cobj_mark_op,
+ cat_mark,
cobj_hash_op },
0, /* put_string */
0, /*_put_char */