mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
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:
parent
b2c8b23c51
commit
f850da7e4b
1 changed files with 2 additions and 1 deletions
|
@ -210,6 +210,7 @@ static void
|
||||||
_trk_element_weak_notify_cb (GstFramePositioner * pos, GObject * old)
|
_trk_element_weak_notify_cb (GstFramePositioner * pos, GObject * old)
|
||||||
{
|
{
|
||||||
pos->track_source = NULL;
|
pos->track_source = NULL;
|
||||||
|
gst_object_unref (pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -221,7 +222,7 @@ ges_frame_positioner_set_source_and_filter (GstFramePositioner * pos,
|
||||||
pos->current_track = ges_track_element_get_track (trksrc);
|
pos->current_track = ges_track_element_get_track (trksrc);
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (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,
|
g_signal_connect (trksrc, "notify::track", (GCallback) _track_changed_cb,
|
||||||
pos);
|
pos);
|
||||||
set_track (pos);
|
set_track (pos);
|
||||||
|
|
Loading…
Reference in a new issue