Add:core: add graphics_font_destroy for cleaning up struct graphics_font
authorwoglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 20 Jun 2012 07:50:23 +0000 (07:50 +0000)
committerwoglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 20 Jun 2012 07:50:23 +0000 (07:50 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5153 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/graphics.c
navit/navit/graphics.h

index 81482aa..8552c20 100644 (file)
@@ -393,6 +393,10 @@ struct graphics_font * graphics_named_font_new(struct graphics *gra, char *font,
        return this_;
 }
 
+void graphics_font_destroy(struct graphics_font *gra_font) {
+       gra_font->meth.font_destroy(gra_font->priv);
+       g_free(gra_font);
+}
 
 /**
  * Destroy graphics
index 1b9eb70..2bdc77d 100644 (file)
@@ -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_font_destroy(struct graphics_font *gra_font);
 void graphics_free(struct graphics *gra);
 void graphics_font_destroy_all(struct graphics *gra);
 struct graphics_gc *graphics_gc_new(struct graphics *gra);