summaryrefslogtreecommitdiff
path: root/dbus/dbus-message.h
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/dbus-message.h')
-rw-r--r--dbus/dbus-message.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h
index 9e7ae7fe..8a9d57a0 100644
--- a/dbus/dbus-message.h
+++ b/dbus/dbus-message.h
@@ -351,6 +351,25 @@ DBUS_EXPORT
dbus_bool_t dbus_message_get_allow_interactive_authorization (
DBusMessage *message);
+/**
+ * Clear a variable or struct member that contains a #DBusMessage.
+ * If it does not contain #NULL, the message that was previously
+ * there is unreferenced with dbus_message_unref().
+ *
+ * This is very similar to dbus_clear_connection(): see that function
+ * for more details.
+ *
+ * @param pointer_to_message A pointer to a variable or struct member.
+ * pointer_to_message must not be #NULL, but *pointer_to_message
+ * may be #NULL.
+ */
+static inline void
+dbus_clear_message (DBusMessage **pointer_to_message)
+{
+ _dbus_clear_pointer_impl (DBusMessage, pointer_to_message,
+ dbus_message_unref);
+}
+
/** @} */
DBUS_END_DECLS