sd-bus: introduce new sd_bus_default_flush_close() call

If code enqueues a message on one of the default busses, but doesn't
sync on it, and immediately drops the reference to the bus again, it
will stay queued and consume memory. Intrdouce a new call
sd_bus_default_flush_close() that can be invoked at the end of programs
(or threads) and flushes out all unsent messages on any of the default
busses.
This commit is contained in:
Lennart Poettering
2015-09-22 16:29:10 +02:00
parent c97e586d8a
commit fa2f8973ad
4 changed files with 31 additions and 5 deletions
+2
View File
@@ -7705,5 +7705,7 @@ finish:
strv_free(arg_states);
strv_free(arg_properties);
sd_bus_default_flush_close();
return r < 0 ? EXIT_FAILURE : r;
}