diff --git a/man/rules/meson.build b/man/rules/meson.build
index 75e36601253..059197500da 100644
--- a/man/rules/meson.build
+++ b/man/rules/meson.build
@@ -272,7 +272,14 @@ manpages = [
'3',
['sd_bus_negotiate_creds', 'sd_bus_negotiate_timestamp'],
''],
- ['sd_bus_new', '3', ['sd_bus_ref', 'sd_bus_unref', 'sd_bus_unrefp'], ''],
+ ['sd_bus_new',
+ '3',
+ ['sd_bus_flush_close_unref',
+ 'sd_bus_flush_close_unrefp',
+ 'sd_bus_ref',
+ 'sd_bus_unref',
+ 'sd_bus_unrefp'],
+ ''],
['sd_bus_path_encode',
'3',
['sd_bus_path_decode', 'sd_bus_path_decode_many', 'sd_bus_path_encode_many'],
diff --git a/man/sd_bus_new.xml b/man/sd_bus_new.xml
index 59117676fde..1bc011d70a1 100644
--- a/man/sd_bus_new.xml
+++ b/man/sd_bus_new.xml
@@ -23,6 +23,8 @@
sd_bus_ref
sd_bus_unref
sd_bus_unrefp
+ sd_bus_flush_close_unref
+ sd_bus_flush_close_unrefp
Create a new bus object and create or destroy references to it
@@ -50,6 +52,16 @@
void sd_bus_unrefp
sd_bus **busp
+
+
+ sd_bus *sd_bus_flush_close_unref
+ sd_bus *bus
+
+
+
+ void sd_bus_flush_close_unrefp
+ sd_bus **busp
+
@@ -111,6 +123,18 @@
dereference its argument, which must not be NULL, and will
execute no operation if that is NULL.
+
+ sd_bus_flush_close_unref() is similar to sd_bus_unref(), but first
+ executes sd_bus_flush3 as well
+ as sd_bus_close3, ensuring that
+ any pending messages are properly flushed out before the reference to the connection is dropped and possibly the
+ object freed. This call is particularly useful immediately before exiting from a program as it ensures that any
+ pending outgoing messages are written out, and unprocessed but queued incoming messages released before the
+ connection is terminated and released.
+
+ sd_bus_flush_close_unrefp() is similar to
+ sd_bus_flush_close_unref(), but may be used in GCC's and LLVM's Clean-up Variable Attribute,
+ see above.
@@ -123,7 +147,7 @@
sd_bus_ref() always returns the argument.
- sd_bus_unref() always returns
+ sd_bus_unref() and sd_bus_flush_close_unref() always return
NULL.
@@ -152,7 +176,8 @@
sd_bus_default_user3,
sd_bus_default_system3,
sd_bus_open_user3,
- sd_bus_open_system3
+ sd_bus_open_system3,
+ sd_bus_close3