framepositioner: Fix invalid memory access

The GstFramePositioner might be finalized before the notify callback

Without this commit,
gst-editing-services / ges_basic / test_ges_timeline_remove_track
can reproduce the case.
This commit is contained in:
Seungha Yang 2019-01-14 22:14:18 +09:00 committed by Thibault Saunier
parent b2c8b23c51
commit f850da7e4b

View file

@ -210,6 +210,7 @@ static void
_trk_element_weak_notify_cb (GstFramePositioner * pos, GObject * old)
{
pos->track_source = NULL;
gst_object_unref (pos);
}
void
@ -221,7 +222,7 @@ ges_frame_positioner_set_source_and_filter (GstFramePositioner * pos,
pos->current_track = ges_track_element_get_track (trksrc);
g_object_weak_ref (G_OBJECT (trksrc),
(GWeakNotify) _trk_element_weak_notify_cb, pos);
(GWeakNotify) _trk_element_weak_notify_cb, gst_object_ref (pos));
g_signal_connect (trksrc, "notify::track", (GCallback) _track_changed_cb,
pos);
set_track (pos);