diff --git a/include/nm-utils-internal.h b/include/nm-utils-internal.h index 7ca44f3c4b..227a210b2c 100644 --- a/include/nm-utils-internal.h +++ b/include/nm-utils-internal.h @@ -160,4 +160,17 @@ NM_DEFINE_SINGLETON_DESTRUCTOR(TYPE) /*****************************************************************************/ +static inline gboolean +nm_clear_g_source (guint *id) +{ + if (id && *id) { + g_source_remove (*id); + *id = 0; + return TRUE; + } + return FALSE; +} + +/*****************************************************************************/ + #endif