mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 18:20:10 +01:00
macros: add nm_clear_g_signal_handler() helper
This commit is contained in:
parent
6f9a7a8daa
commit
c98c7a486c
1 changed files with 13 additions and 0 deletions
|
|
@ -198,6 +198,19 @@ nm_clear_g_source (guint *id)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
nm_clear_g_signal_handler (gpointer self, guint *id)
|
||||
{
|
||||
g_return_val_if_fail (G_IS_OBJECT (self), FALSE);
|
||||
|
||||
if (id && *id) {
|
||||
g_signal_handler_disconnect (self, *id);
|
||||
*id = 0;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Determine whether @x is a power of two (@x being an integer type).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue