diff options
author | Justin Kim <justin.kim@collabora.com> | 2015-09-28 13:21:11 +0900 |
---|---|---|
committer | Thibault Saunier <tsaunier@gnome.org> | 2015-09-28 16:01:05 +0200 |
commit | b102fa679b5d86402201b83d0bc7db60166296f4 (patch) | |
tree | 557d2a23143e44eabe997f0777d1985f323ad478 | |
parent | da34328c50f7d146d3e31655b32376b961682a49 (diff) |
structure-parser: define GES_STRUCTURE_PARSER macro
And fix trivial leakages of internal list structure.
https://bugzilla.gnome.org/show_bug.cgi?id=755716
-rw-r--r-- | ges/ges-structure-parser.c | 11 | ||||
-rw-r--r-- | ges/ges-structure-parser.h | 1 |
2 files changed, 4 insertions, 8 deletions
diff --git a/ges/ges-structure-parser.c b/ges/ges-structure-parser.c index 5c276fd5..8acb0480 100644 --- a/ges/ges-structure-parser.c +++ b/ges/ges-structure-parser.c @@ -32,15 +32,10 @@ ges_structure_parser_init (GESStructureParser * self) static void _finalize (GObject * self) { - GList *tmp; - - for (tmp = ((GESStructureParser *) self)->structures; tmp; tmp = tmp->next) { - gst_structure_free (tmp->data); - } + GESStructureParser *parser = GES_STRUCTURE_PARSER (self); - for (tmp = ((GESStructureParser *) self)->wrong_strings; tmp; tmp = tmp->next) { - g_free (tmp->data); - } + g_list_free_full (parser->structures, (GDestroyNotify) gst_structure_free); + g_list_free_full (parser->wrong_strings, (GDestroyNotify) g_free); } static void diff --git a/ges/ges-structure-parser.h b/ges/ges-structure-parser.h index 587c7ce1..9dedbc41 100644 --- a/ges/ges-structure-parser.h +++ b/ges/ges-structure-parser.h @@ -26,6 +26,7 @@ G_BEGIN_DECLS #define GES_TYPE_STRUCTURE_PARSER ges_structure_parser_get_type() +#define GES_STRUCTURE_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_STRUCTURE_PARSER, GESStructureParser)) typedef struct _GESStructureParser GESStructureParser; typedef struct _GESStructureParserClass GESStructureParserClass; |