summaryrefslogtreecommitdiff
path: root/dbus/dbus-hash.h
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-07-21 19:12:30 +0100
committerSimon McVittie <smcv@debian.org>2017-07-30 08:48:43 +0100
commite13f29cae788ee0d0d16352c9be2d9e14a5a0b3d (patch)
treee3bf2e0d7e270c8145f85f74e0f1f5cf8ee6b3f7 /dbus/dbus-hash.h
parente9974f76a938e155c7d16c913b8cae41ef9cb9fe (diff)
downloaddbus-e13f29cae788ee0d0d16352c9be2d9e14a5a0b3d.tar.gz
Implement dbus_clear_connection(), etc.
These are inspired by GLib's g_clear_pointer() and g_clear_object(), which in turn is descended from CPython's Py_CLEAR_OBJECT. They should make our code a lot less repetitive. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101895
Diffstat (limited to 'dbus/dbus-hash.h')
-rw-r--r--dbus/dbus-hash.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/dbus/dbus-hash.h b/dbus/dbus-hash.h
index 93f717a9..fadab91f 100644
--- a/dbus/dbus-hash.h
+++ b/dbus/dbus-hash.h
@@ -210,6 +210,12 @@ _dbus_hash_table_insert_pollable (DBusHashTable *table,
#endif
}
+static inline void
+_dbus_clear_hash_table (DBusHashTable **table_p)
+{
+ _dbus_clear_pointer_impl (DBusHashTable, table_p, _dbus_hash_table_unref);
+}
+
/** @} */
DBUS_END_DECLS