diff --git a/src/app-utils/guile-util.c b/src/app-utils/guile-util.c index 476e14ad2d..f592b3f1cd 100644 --- a/src/app-utils/guile-util.c +++ b/src/app-utils/guile-util.c @@ -1278,9 +1278,10 @@ gnc_detach_process (Process *proc, const gboolean kill_it) errno = 0; } - if (kill_it) { + if (kill_it && !proc->dead) { /* give it a chance to die */ - g_main_context_iteration (NULL, FALSE); + while (g_main_context_iteration (NULL, FALSE) && !proc->dead) + ; if (!proc->dead) gnc_gpid_kill (proc->pid); }