webrtc/nice/nice.c: resolve_host_async uses thread associated with default GMainContext to return results
-
gstwebrtcbin
creates it's own internal helper thread with ownGMainContext
; -
gstwebrtcbin
by some reason doesn't useg_main_context_push_thread_default
onGMainContext
create; -
resolve_host_async
createsGTask
withg_task_new
to get result of host resolving; - According to docs for
g_task_new
:
Creates a `GTask` acting on `source_object`, which will eventually be used to invoke callback in the current thread-default main context.
But there is no thread default main context in that case and global-default main context will be used.
Obviously, it can lead to multi threading race conditions. Also, not so obviously, it can lead to wrong behavior and memory/resource leaks if there is no thread associated with global-default main context.