diff options
author | Dan Williams <dcbw@redhat.com> | 2014-10-14 16:35:07 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-12-11 10:07:41 -0600 |
commit | 1719d6f21440f5f5db9d347a6eb47cc4cbafaa00 (patch) | |
tree | fd0d0db3572b96a22362593fd88a369cc91874af | |
parent | db602934cc509c27cc7ce0f11dc3d48dd1865b48 (diff) | |
download | NetworkManager-1719d6f21440f5f5db9d347a6eb47cc4cbafaa00.tar.gz |
fixup! core: add class function for device unrealization
-rw-r--r-- | src/devices/nm-device.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index e4d7f765f7..5d76b5130d 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1522,20 +1522,34 @@ nm_device_unrealize (NMDevice *self, gboolean link_deleted, GError **error) if (NM_DEVICE_GET_CLASS (self)->unrealize) success = NM_DEVICE_GET_CLASS (self)->unrealize (self, link_deleted, error); + g_object_freeze_notify (G_OBJECT (self)); + priv->ifindex = 0; priv->ip_ifindex = 0; - g_clear_pointer (&priv->ip_iface, g_free); - g_object_notify (G_OBJECT (self), NM_DEVICE_IP_IFACE); - g_clear_pointer (&priv->driver_version, g_free); - g_object_notify (G_OBJECT (self), NM_DEVICE_DRIVER_VERSION); - g_clear_pointer (&priv->firmware_version, g_free); - g_object_notify (G_OBJECT (self), NM_DEVICE_FIRMWARE_VERSION); - g_clear_pointer (&priv->udi, g_free); - g_object_notify (G_OBJECT (self), NM_DEVICE_UDI); - g_clear_pointer (&priv->hw_addr, g_free); - g_object_notify (G_OBJECT (self), NM_DEVICE_HW_ADDRESS); - g_clear_pointer (&priv->physical_port_id, g_free); - g_object_notify (G_OBJECT (self), NM_DEVICE_PHYSICAL_PORT_ID); + if (priv->ip_iface) { + g_clear_pointer (&priv->ip_iface, g_free); + g_object_notify (G_OBJECT (self), NM_DEVICE_IP_IFACE); + } + if (priv->driver_version) { + g_clear_pointer (&priv->driver_version, g_free); + g_object_notify (G_OBJECT (self), NM_DEVICE_DRIVER_VERSION); + } + if (priv->firmware_version) { + g_clear_pointer (&priv->firmware_version, g_free); + g_object_notify (G_OBJECT (self), NM_DEVICE_FIRMWARE_VERSION); + } + if (priv->udi) { + g_clear_pointer (&priv->udi, g_free); + g_object_notify (G_OBJECT (self), NM_DEVICE_UDI); + } + if (priv->hw_addr) { + g_clear_pointer (&priv->hw_addr, g_free); + g_object_notify (G_OBJECT (self), NM_DEVICE_HW_ADDRESS); + } + if (priv->physical_port_id) { + g_clear_pointer (&priv->physical_port_id, g_free); + g_object_notify (G_OBJECT (self), NM_DEVICE_PHYSICAL_PORT_ID); + } g_clear_pointer (&priv->perm_hw_addr, g_free); g_clear_pointer (&priv->initial_hw_addr, g_free); @@ -1546,6 +1560,8 @@ nm_device_unrealize (NMDevice *self, gboolean link_deleted, GError **error) priv->real = FALSE; g_object_notify (G_OBJECT (self), NM_DEVICE_REAL); + g_object_thaw_notify (G_OBJECT (self)); + return success; } |