mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-02 08:27:59 +02:00
core: return boolean result from nm_dbus_object_clear_and_unexport()
To indicate, whether something was cleared. This will be used later.
This commit is contained in:
parent
80f6f4e115
commit
d1457410fd
2 changed files with 7 additions and 5 deletions
|
|
@ -183,23 +183,25 @@ nm_dbus_object_unexport_on_idle(gpointer /* (NMDBusObject *) */ self_take)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
gboolean
|
||||
_nm_dbus_object_clear_and_unexport(NMDBusObject **location)
|
||||
{
|
||||
NMDBusObject *self;
|
||||
|
||||
g_return_if_fail(location);
|
||||
g_return_val_if_fail(location, FALSE);
|
||||
|
||||
if (!*location)
|
||||
return;
|
||||
return FALSE;
|
||||
|
||||
self = g_steal_pointer(location);
|
||||
|
||||
g_return_if_fail(NM_IS_DBUS_OBJECT(self));
|
||||
g_return_val_if_fail(NM_IS_DBUS_OBJECT(self), FALSE);
|
||||
|
||||
if (self->internal.path)
|
||||
nm_dbus_object_unexport(self);
|
||||
|
||||
g_object_unref(self);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ void nm_dbus_object_unexport(gpointer /* (NMDBusObject *) */ self);
|
|||
|
||||
void nm_dbus_object_unexport_on_idle(gpointer /* (NMDBusObject *) */ self_take);
|
||||
|
||||
void _nm_dbus_object_clear_and_unexport(NMDBusObject **location);
|
||||
gboolean _nm_dbus_object_clear_and_unexport(NMDBusObject **location);
|
||||
#define nm_dbus_object_clear_and_unexport(location) \
|
||||
_nm_dbus_object_clear_and_unexport(NM_CAST_PPTR(NMDBusObject, (location)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue