* Re-add the cx->torender trick to avoid crashing on filters. This really

needs some architecture thinking.
This commit is contained in:
Sam Hocevar 2008-06-15 14:59:25 +00:00 committed by sam
parent ec08c3d6c0
commit 71ab147f05
2 changed files with 6 additions and 2 deletions

View file

@ -59,7 +59,10 @@ static int feed_figlet(context_t *cx, uint32_t ch, uint32_t attr)
static int flush_figlet(context_t *cx) 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) static int end_figlet(context_t *cx)

View file

@ -156,11 +156,12 @@ static int render_flush(context_t *cx)
filter_do(cx); filter_do(cx);
/* Output line */ /* Output line */
buffer = cucul_export_memory(cx->cv, cx->export, &len); buffer = cucul_export_memory(cx->torender, cx->export, &len);
if(!buffer) if(!buffer)
return -1; return -1;
fwrite(buffer, len, 1, stdout); fwrite(buffer, len, 1, stdout);
free(buffer); free(buffer);
cucul_free_canvas(cx->torender);
return 0; return 0;
} }