Also don't try to clean up a process we didn't start.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
f->activated = NULL;
}
- test_kill_pid (f->daemon_pid);
- g_spawn_close_pid (f->daemon_pid);
- test_main_context_unref (f->ctx);
+ if (f->daemon_pid != 0)
+ {
+ test_kill_pid (f->daemon_pid);
+ g_spawn_close_pid (f->daemon_pid);
+ }
+
+ if (f->ctx != NULL)
+ test_main_context_unref (f->ctx);
+
g_free (f->address);
}