mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
clock: fix racy shutdown clock id leak
Clock IDs were leaked if the clock got disposed before the worker thread got a chance to reap unscheduled entries. Fixes bug #630439.
This commit is contained in:
parent
90d65cb446
commit
a95eacb56a
1 changed files with 4 additions and 2 deletions
|
@ -198,8 +198,6 @@ gst_system_clock_dispose (GObject * object)
|
||||||
GST_CAT_DEBUG (GST_CAT_CLOCK, "unscheduling entry %p", entry);
|
GST_CAT_DEBUG (GST_CAT_CLOCK, "unscheduling entry %p", entry);
|
||||||
entry->status = GST_CLOCK_UNSCHEDULED;
|
entry->status = GST_CLOCK_UNSCHEDULED;
|
||||||
}
|
}
|
||||||
g_list_free (clock->entries);
|
|
||||||
clock->entries = NULL;
|
|
||||||
GST_CLOCK_BROADCAST (clock);
|
GST_CLOCK_BROADCAST (clock);
|
||||||
gst_system_clock_add_wakeup (sysclock);
|
gst_system_clock_add_wakeup (sysclock);
|
||||||
GST_OBJECT_UNLOCK (clock);
|
GST_OBJECT_UNLOCK (clock);
|
||||||
|
@ -209,6 +207,10 @@ gst_system_clock_dispose (GObject * object)
|
||||||
sysclock->thread = NULL;
|
sysclock->thread = NULL;
|
||||||
GST_CAT_DEBUG (GST_CAT_CLOCK, "joined thread");
|
GST_CAT_DEBUG (GST_CAT_CLOCK, "joined thread");
|
||||||
|
|
||||||
|
g_list_foreach (clock->entries, (GFunc) gst_clock_id_unref, NULL);
|
||||||
|
g_list_free (clock->entries);
|
||||||
|
clock->entries = NULL;
|
||||||
|
|
||||||
gst_poll_free (sysclock->priv->timer);
|
gst_poll_free (sysclock->priv->timer);
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||||
|
|
Loading…
Reference in a new issue