From 8468bbbb2d9b865dcbe8728043936969d4859877 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 28 Mar 2009 01:27:44 +0000 Subject: Aliasing fixes svn path=/trunk/netsurf/; revision=6961 --- image/mng.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'image') diff --git a/image/mng.c b/image/mng.c index b029301e8..08de81724 100644 --- a/image/mng.c +++ b/image/mng.c @@ -365,8 +365,14 @@ bool nsmng_convert(struct content *c, int width, int height) /* free associated memory except for mngs where it may be subsequently needed for * animation decoding. */ - if (c->type != CONTENT_MNG) - mng_cleanup((mng_handle *) &c->data.mng.handle); + if (c->type != CONTENT_MNG) { + mng_handle handle = c->data.mng.handle; + + mng_cleanup(&handle); + + c->data.mng.handle = NULL; + } + return true; } @@ -505,10 +511,17 @@ void nsmng_destroy(struct content *c) /* Cleanup the MNG structure and release the canvas memory */ schedule_remove(nsmng_animate, c); - if (c->type == CONTENT_MNG) - mng_cleanup((mng_handle *) &c->data.mng.handle); + if (c->type == CONTENT_MNG) { + mng_handle handle = c->data.mng.handle; + + mng_cleanup(&handle); + + c->data.mng.handle = NULL; + } + if (c->bitmap) bitmap_destroy(c->bitmap); + free(c->title); } -- cgit v1.2.3