meta-container: Plug various leaks

This commit is contained in:
Thibault Saunier 2012-12-29 18:02:35 -03:00
parent bf1e966d25
commit ac7dd69a71

View file

@ -14,7 +14,8 @@ static GQuark ges_meta_key;
G_DEFINE_INTERFACE_WITH_CODE (GESMetaContainer, ges_meta_container, G_DEFINE_INTERFACE_WITH_CODE (GESMetaContainer, ges_meta_container,
G_TYPE_OBJECT, ges_meta_key = G_TYPE_OBJECT, ges_meta_key =
g_quark_from_static_string ("ges-meta-container-data");); g_quark_from_static_string ("ges-meta-container-data");
);
enum enum
{ {
@ -393,9 +394,7 @@ ges_meta_container_set_meta (GESMetaContainer * container,
if (_can_write_value (container, meta_item, G_VALUE_TYPE (value)) == FALSE) if (_can_write_value (container, meta_item, G_VALUE_TYPE (value)) == FALSE)
return FALSE; return FALSE;
_set_value (container, meta_item, value); return _set_value (container, meta_item, value);
return TRUE;
} }
/** /**
@ -446,6 +445,7 @@ ges_meta_container_add_metas_from_string (GESMetaContainer * container,
gst_structure_foreach (n_structure, (GstStructureForeachFunc) _append_foreach, gst_structure_foreach (n_structure, (GstStructureForeachFunc) _append_foreach,
container); container);
gst_structure_free (n_structure);
return TRUE; return TRUE;
} }
@ -454,6 +454,7 @@ gboolean \
ges_meta_container_register_meta_ ## name (GESMetaContainer *container,\ ges_meta_container_register_meta_ ## name (GESMetaContainer *container,\
GESMetaFlag flags, const gchar *meta_item, value_ctype value) \ GESMetaFlag flags, const gchar *meta_item, value_ctype value) \
{ \ { \
gboolean ret; \
GValue gval = { 0 }; \ GValue gval = { 0 }; \
\ \
g_return_val_if_fail (GES_IS_META_CONTAINER (container), FALSE); \ g_return_val_if_fail (GES_IS_META_CONTAINER (container), FALSE); \
@ -465,7 +466,10 @@ ges_meta_container_register_meta_ ## name (GESMetaContainer *container,\
g_value_init (&gval, value_gtype); \ g_value_init (&gval, value_gtype); \
g_value_set_ ##setter_name (&gval, value); \ g_value_set_ ##setter_name (&gval, value); \
\ \
return _set_value (container, meta_item, &gval); \ ret = _set_value (container, meta_item, &gval); \
\
g_value_unset (&gval); \
return ret; \
} }
/** /**