Give the child process a real chance to die before we kill it.

Improve r15997 by processing all events without blocking, maybe until
the child is dead.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16015 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler
2007-04-28 16:04:06 +00:00
parent 4fc3ccb0ba
commit 433a0cd5e2

View File

@@ -1278,9 +1278,10 @@ gnc_detach_process (Process *proc, const gboolean kill_it)
errno = 0; errno = 0;
} }
if (kill_it) { if (kill_it && !proc->dead) {
/* give it a chance to die */ /* give it a chance to die */
g_main_context_iteration (NULL, FALSE); while (g_main_context_iteration (NULL, FALSE) && !proc->dead)
;
if (!proc->dead) if (!proc->dead)
gnc_gpid_kill (proc->pid); gnc_gpid_kill (proc->pid);
} }