free existing strings before assigning new ones

This commit is contained in:
Brandon Lewis 2010-06-17 11:22:30 +02:00 committed by Edward Hervey
parent 8f75344ac2
commit e417c4c656
3 changed files with 23 additions and 0 deletions

View file

@ -279,6 +279,9 @@ ges_tl_title_src_set_text (GESTimelineTitleSource * self, const gchar * text)
GST_DEBUG ("self:%p, text:%s", self, text);
if (self->text)
g_free (self->text);
self->text = g_strdup (text);
for (tmp = object->trackobjects; tmp; tmp = tmp->next) {
@ -299,6 +302,9 @@ ges_tl_title_src_set_font_desc (GESTimelineTitleSource * self, const gchar *
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
if (self->font_desc)
g_free (self->font_desc);
self->font_desc = g_strdup (font_desc);
for (tmp = object->trackobjects; tmp; tmp = tmp->next) {

View file

@ -460,6 +460,12 @@ ges_type_timeline_transition_vtype_get_type (void)
return the_type;
}
/**
* ges_timeline_transition_new:
* @vtype: the type of transition to create
*
*/
GESTimelineTransition *
ges_timeline_transition_new (gint vtype)
{
@ -471,6 +477,11 @@ ges_timeline_transition_new (gint vtype)
return ret;
}
/**
* ges_timeline_transition_new_for_nick:
* @nick: a string representing the type of transition to create
*/
GESTimelineTransition *
ges_timeline_transition_new_for_nick (gchar * nick)
{

View file

@ -181,6 +181,9 @@ void
ges_track_video_title_source_set_text (GESTrackVideoTitleSource * self,
const gchar * text)
{
if (self->text)
g_free (self->text);
self->text = g_strdup (text);
if (self->text_el)
g_object_set (self->text_el, "text", text, NULL);
@ -199,6 +202,9 @@ void
ges_track_video_title_source_set_font_desc (GESTrackVideoTitleSource * self,
const gchar * font_desc)
{
if (self->font_desc)
g_free (self->font_desc);
self->font_desc = g_strdup (font_desc);
GST_LOG ("setting font-desc to '%s'", font_desc);
if (self->text_el)