timeline: return sunk element on pasting
authorHenry Wilkes <hwilkes@igalia.com>
Mon, 6 Apr 2020 11:17:43 +0000 (12:17 +0100)
committerHenry Wilkes <hwilkes@igalia.com>
Wed, 8 Apr 2020 13:35:28 +0000 (14:35 +0100)
Technically, an element can still be floating on the return from
`->paste` (e.g. a clip not in a layer). Since the return of the `_paste`
methods are (return full) a non-floating object is probably expected in
all cases.

ges/ges-timeline-element.c
ges/ges-timeline.c

index ade0134..1d082b8 100644 (file)
@@ -2377,7 +2377,7 @@ ges_timeline_element_paste (GESTimelineElement * self,
 
   g_clear_object (&self->priv->copied_from);
 
-  return res ? g_object_ref (res) : res;
+  return res ? g_object_ref_sink (res) : res;
 }
 
 /**
index af1ce6e..48563ff 100644 (file)
@@ -3035,7 +3035,7 @@ ges_timeline_paste_element (GESTimeline * timeline,
 
   gst_object_unref (copied_from);
 
-  return res ? g_object_ref (res) : res;
+  return res ? g_object_ref_sink (res) : res;
 }
 
 /**