Otherwise it would have attached to a newly created context
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 */
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);