From 07094416ec1dfeb2163b91c1a72a080e3c3bafc6 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Mon, 5 Mar 2018 22:30:44 +0100 Subject: [PATCH] Add _dbus_clear_loop and _dbus_clear_watch https://bugs.freedesktop.org/show_bug.cgi?id=92831 --- dbus/dbus-mainloop.h | 7 +++++++ dbus/dbus-watch.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/dbus/dbus-mainloop.h b/dbus/dbus-mainloop.h index a76cb6f0..1a9266bb 100644 --- a/dbus/dbus-mainloop.h +++ b/dbus/dbus-mainloop.h @@ -60,6 +60,13 @@ dbus_bool_t _dbus_loop_dispatch (DBusLoop *loop); int _dbus_get_oom_wait (void); void _dbus_wait_for_memory (void); +static inline void +_dbus_clear_loop (DBusLoop **pointer_to_connection) +{ + _dbus_clear_pointer_impl (DBusLoop, pointer_to_connection, + _dbus_loop_unref); +} + #endif /* !DOXYGEN_SHOULD_SKIP_THIS */ #endif /* DBUS_MAINLOOP_H */ diff --git a/dbus/dbus-watch.h b/dbus/dbus-watch.h index 8d8bbf2b..0abe9003 100644 --- a/dbus/dbus-watch.h +++ b/dbus/dbus-watch.h @@ -99,6 +99,13 @@ DBusSocket _dbus_watch_get_socket (DBusWatch *watch); DBUS_PRIVATE_EXPORT DBusPollable _dbus_watch_get_pollable (DBusWatch *watch); +static inline void +_dbus_clear_watch (DBusWatch **pointer_to_connection) +{ + _dbus_clear_pointer_impl (DBusWatch, pointer_to_connection, + _dbus_watch_unref); +} + /** @} */ DBUS_END_DECLS -- 2.16.2