diff options
author | woglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-01-20 21:32:30 +0000 |
---|---|---|
committer | woglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-01-20 21:32:30 +0000 |
commit | e1738621bf6e4dd4da709346583ff716d9c6af0a (patch) | |
tree | e19a0fa3988ff10c8b83ae98a91906f975320efa /navit/graphics.c | |
parent | a38766565be6a075efba929e2a2b69caed53daf1 (diff) | |
download | navit-svn-e1738621bf6e4dd4da709346583ff716d9c6af0a.tar.gz |
Fix:core:When destroying the graphics, destroy the graphics_gc's too, guard graphics_destroy_gc against null pointer
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4900 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/graphics.c')
-rw-r--r-- | navit/graphics.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/navit/graphics.c b/navit/graphics.c index 165d02db..2040e72d 100644 --- a/navit/graphics.c +++ b/navit/graphics.c @@ -402,6 +402,9 @@ void graphics_free(struct graphics *gra) { if (!gra) return; + graphics_gc_destroy(gra->gc[0]); + graphics_gc_destroy(gra->gc[1]); + graphics_gc_destroy(gra->gc[2]); gra->meth.graphics_destroy(gra->priv); g_free(gra->default_font); graphics_font_destroy_all(gra); @@ -449,6 +452,8 @@ struct graphics_gc * graphics_gc_new(struct graphics *gra) */ void graphics_gc_destroy(struct graphics_gc *gc) { + if (!gc) + return; gc->meth.gc_destroy(gc->priv); g_free(gc); } |