Commit a5c8a141 authored by Olivier Crête's avatar Olivier Crête
Browse files

agent: Attaching to a NULL context should attach to the default one

Otherwise it would have attached to a newly created context
parent ce90943f
......@@ -3660,9 +3660,6 @@ nice_agent_attach_recv (
Stream *stream = NULL;
gboolean ret = FALSE;
/* ctx must be non-NULL if func is non-NULL. */
g_return_val_if_fail (func == NULL || ctx != NULL, FALSE);
agent_lock();
/* attach candidates */
......@@ -3674,6 +3671,9 @@ nice_agent_attach_recv (
goto done;
}
if (ctx == NULL)
ctx = g_main_context_default ();
/* Set the component’s I/O context. */
component_set_io_context (component, ctx);
component_set_io_callback (component, func, data, NULL, 0, NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment