isl_stream: properly reference ctx
authorSven Verdoolaege <sven@cs.kuleuven.be>
Thu, 25 Dec 2008 13:51:45 +0000 (14:51 +0100)
committerSven Verdoolaege <sven@cs.kuleuven.be>
Thu, 25 Dec 2008 13:51:45 +0000 (14:51 +0100)
isl_stream.c

index 478eb4e..9277e47 100644 (file)
@@ -47,6 +47,7 @@ static struct isl_stream* isl_stream_new(struct isl_ctx *ctx)
        if (!s)
                return NULL;
        s->ctx = ctx;
+       isl_ctx_ref(s->ctx);
        s->size = 256;
        s->file = NULL;
        s->str = NULL;
@@ -297,5 +298,6 @@ void isl_stream_free(struct isl_stream *s)
                isl_stream_error(s, tok, "unexpected token");
                isl_token_free(tok);
        }
+       isl_ctx_deref(s->ctx);
        free(s);
 }