Let's only close our fds, but not unlink it. That's done when the
session is stopped.
This should make sure the fd will survive daemon restarts.
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
- session_remove_fifo(s);
-
session_drop_controller(s);
while ((sd = hashmap_first(s->devices)))
hashmap_remove(s->manager->sessions, s->id);
+ sd_event_source_unref(s->fifo_event_source);
+ safe_close(s->fifo_fd);
+
+ /* Note that we remove neither the state file nor the fifo path here, since we want both to survive
+ * daemon restarts */
free(s->state_file);
+ free(s->fifo_path);
return mfree(s);
}