If I use glib_child_add_watch() to detect when a glib_spawn_async() ended, do I have to call glib_spawn_close_pid() in the callback to fully finalize the glib_spawn_async()? Also, I presume that I don’t have to call inside the callback to glib_source_remove() with the value returned by glib_child_add_watch, but just want to be sure…
Mmmm… Then, that means that there is a bug here, in gnome shell, isn’t it? Because it launches a program with spawn_async() (at line 110), but the child_add_watch() callback is empty. Am I right?
g_spawn_close_pid() doesn’t actually do anything on UNIX, but the documentation says to call it on all platforms anyway. (Maybe g_spawn will use something like pidfd one day instead of raw PIDs.)