draw: stop leaking image on double parsing

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-27 10:08:22 +02:00
parent b63e10b7e8
commit 0fddca87c3
1 changed files with 2 additions and 0 deletions

View File

@ -223,6 +223,8 @@ draw_markup_on_element(markup_parser_data_t *p, const char *elem,
*values, &data->bg_color); *values, &data->bg_color);
break; break;
case A_TK_IMAGE: case A_TK_IMAGE:
if(data->bg_image)
draw_image_delete(&data->bg_image);
data->bg_image = draw_image_new(*values); data->bg_image = draw_image_new(*values);
break; break;
case A_TK_ALIGN: case A_TK_ALIGN: