diff --git a/man/rules/meson.build b/man/rules/meson.build
index 944d2bf286..bc71e0645b 100644
--- a/man/rules/meson.build
+++ b/man/rules/meson.build
@@ -446,6 +446,7 @@ manpages = [
['sd_event_source_unref',
'3',
['sd_event_source_disable_unref',
+ 'sd_event_source_disable_unrefp',
'sd_event_source_ref',
'sd_event_source_unrefp'],
''],
diff --git a/man/sd_event_source_unref.xml b/man/sd_event_source_unref.xml
index 4e2fb8cb39..81131fa737 100644
--- a/man/sd_event_source_unref.xml
+++ b/man/sd_event_source_unref.xml
@@ -20,6 +20,7 @@
sd_event_source_unrefp
sd_event_source_ref
sd_event_source_disable_unref
+ sd_event_source_disable_unrefp
Increase or decrease event source reference counters
@@ -47,6 +48,11 @@
sd_event_source* sd_event_source_disable_unref
sd_event_source *source
+
+
+ void sd_event_source_disable_unrefp
+ sd_event_source **source
+
@@ -94,6 +100,12 @@
sd_event_source_unref(). This ensures that the source is disabled before the local
reference to it is lost. The source parameter is allowed to be
NULL.
+
+ sd_event_source_disable_unrefp() is similar to
+ sd_event_source_unrefp(), but in addition disables the source first. This call is
+ useful in conjunction with GCC's and LLVM's
+ Clean-up Variable
+ Attribute. Note that this function is defined as inline function.
diff --git a/src/systemd/sd-event.h b/src/systemd/sd-event.h
index 226e1b8f26..b14c92697b 100644
--- a/src/systemd/sd-event.h
+++ b/src/systemd/sd-event.h
@@ -150,6 +150,7 @@ int sd_event_source_set_floating(sd_event_source *s, int b);
/* Define helpers so that __attribute__((cleanup(sd_event_unrefp))) and similar may be used. */
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event, sd_event_unref);
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event_source, sd_event_source_unref);
+_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event_source, sd_event_source_disable_unref);
_SD_END_DECLARATIONS;