unreference source, attach child_watch to worker_context

This commit is contained in:
Ómar Högni Guðmarsson 2023-11-28 21:33:21 +00:00 committed by Ómar Högni Guðmarsson
parent 1ef0fde037
commit 4ee3e2012a

View File

@ -797,8 +797,15 @@ g_dbus_address_connect (const gchar *address_entry,
g_spawn_close_pid (child_pid);
goto out;
}
GSource* source;
GMainContext *worker_context;
ret = (GIOStream *) g_socket_connection_factory_create_connection (fdsocket);
g_child_watch_add (child_pid, unixexec_child_watch, ret);
worker_context = GLIB_PRIVATE_CALL (g_get_worker_context) ();
source = g_child_watch_source_new (child_pid);
g_source_set_callback (source, unixexec_child_watch, ret, g_object_unref);
g_source_attach (source, worker_context);
g_source_unref(source);
g_free (argv);
}
#endif