mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-04 23:38:01 +02:00
config-policy: avoid race condition in the unit tests
Clear self->pending_endpoint before sending the done signal, because the signal will trigger a new endpoint to be added in the unit test and this may happen before g_clear_object is called, in which case adding the new endpoint fails
This commit is contained in:
parent
57ffc0435f
commit
57ac90b188
1 changed files with 3 additions and 2 deletions
|
|
@ -73,8 +73,9 @@ on_endpoint_link_created (GObject *initable, GAsyncResult *res, gpointer p)
|
|||
gboolean is_capture =
|
||||
wp_base_endpoint_get_direction (self->pending_endpoint) == PW_DIRECTION_INPUT;
|
||||
if (self->pending_endpoint == (is_capture ? sink_ep : src_ep)) {
|
||||
g_signal_emit (self, signals[SIGNAL_DONE], 0, self->pending_endpoint, link);
|
||||
g_clear_object (&self->pending_endpoint);
|
||||
g_autoptr (WpBaseEndpoint) pending_endpoint =
|
||||
g_steal_pointer (&self->pending_endpoint);
|
||||
g_signal_emit (self, signals[SIGNAL_DONE], 0, pending_endpoint, link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue