core: assert that nm_utils_spawn_helper() is used with default context

This commit is contained in:
Thomas Haller 2023-03-30 08:16:25 +02:00
parent 3411f42418
commit a52d620549
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -5138,6 +5138,12 @@ nm_utils_spawn_helper(const char *const *args,
context = g_task_get_context(info->task);
/* The async function makes a lukewarm attempt to honor the current thread default
* context. However, it later uses nm_utils_kill_child_async() which always uses
* g_main_context_default(). For now, the function really can only be used with the
* main context. */
nm_assert(context == g_main_context_default());
info->child_watch_source = g_child_watch_source_new(info->pid);
g_source_set_callback(info->child_watch_source,
G_SOURCE_FUNC(helper_child_terminated),