diff --git a/src/figlet.c b/src/figlet.c index 0b08443..69cbf66 100644 --- a/src/figlet.c +++ b/src/figlet.c @@ -59,7 +59,10 @@ static int feed_figlet(context_t *cx, uint32_t ch, uint32_t attr) static int flush_figlet(context_t *cx) { - return cucul_flush_figlet(cx->cv); + int ret = cucul_flush_figlet(cx->cv); + cx->torender = cx->cv; + cx->cv = cucul_create_canvas(0, 0); + return ret; } static int end_figlet(context_t *cx) diff --git a/src/render.c b/src/render.c index d01d2e0..f071a51 100644 --- a/src/render.c +++ b/src/render.c @@ -156,11 +156,12 @@ static int render_flush(context_t *cx) filter_do(cx); /* Output line */ - buffer = cucul_export_memory(cx->cv, cx->export, &len); + buffer = cucul_export_memory(cx->torender, cx->export, &len); if(!buffer) return -1; fwrite(buffer, len, 1, stdout); free(buffer); + cucul_free_canvas(cx->torender); return 0; }