From c02710bb0f64ab94e777be1641c380ff81fe14ce Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 15 Oct 2019 17:40:10 +0200 Subject: [PATCH] shared: add nm_g_source_destroy_and_unref() helper --- shared/nm-glib-aux/nm-shared-utils.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h index 29ff82844..1252ffe44 100644 --- a/shared/nm-glib-aux/nm-shared-utils.h +++ b/shared/nm-glib-aux/nm-shared-utils.h @@ -894,6 +894,13 @@ nm_g_variant_unref_floating (GVariant *var) g_variant_unref (var); } +static inline void +nm_g_source_destroy_and_unref (GSource *source) +{ + g_source_destroy (source); + g_source_unref (source); +} + /*****************************************************************************/ static inline int