diff options
-rw-r--r-- | navit/graphics.c | 11 | ||||
-rw-r--r-- | navit/graphics.h | 1 | ||||
-rw-r--r-- | navit/navit.c | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/navit/graphics.c b/navit/graphics.c index 0a3437561..19c9c4294 100644 --- a/navit/graphics.c +++ b/navit/graphics.c @@ -383,6 +383,17 @@ struct graphics_font * graphics_named_font_new(struct graphics *gra, char *font, } +/** + * Destroy graphics + * Called when navit exits + * @param gra The graphics instance + * @returns nothing + * @author David Tegze (02/2011) + */ +void graphics_free(struct graphics *gra) +{ + gra->meth.graphics_destroy(gra->priv); +} /** * Free all loaded fonts. diff --git a/navit/graphics.h b/navit/graphics.h index 1b220a3b3..2e5ba24a0 100644 --- a/navit/graphics.h +++ b/navit/graphics.h @@ -148,6 +148,7 @@ void graphics_add_callback(struct graphics *this_, struct callback *cb); void graphics_remove_callback(struct graphics *this_, struct callback *cb); struct graphics_font *graphics_font_new(struct graphics *gra, int size, int flags); struct graphics_font *graphics_named_font_new(struct graphics *gra, char *font, int size, int flags); +void graphics_free(struct graphics *gra); void graphics_font_destroy_all(struct graphics *gra); struct graphics_gc *graphics_gc_new(struct graphics *gra); void graphics_gc_destroy(struct graphics_gc *gc); diff --git a/navit/navit.c b/navit/navit.c index d6e9aac61..d855b1b3b 100644 --- a/navit/navit.c +++ b/navit/navit.c @@ -2778,6 +2778,7 @@ navit_destroy(struct navit *this_) graphics_remove_callback(this_->gra, this_->predraw_callback); callback_destroy(this_->predraw_callback); route_destroy(this_->route); + graphics_free(this_->gra); g_free(this_); } |