diff --git a/src/devices/nm-device-macsec.c b/src/devices/nm-device-macsec.c index f1878078b2..94edc9473a 100644 --- a/src/devices/nm-device-macsec.c +++ b/src/devices/nm-device-macsec.c @@ -863,15 +863,14 @@ static void dispose (GObject *object) { NMDeviceMacsec *self = NM_DEVICE_MACSEC (object); - NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE (self); macsec_secrets_cancel (self); supplicant_interface_release (self); G_OBJECT_CLASS (nm_device_macsec_parent_class)->dispose (object); - nm_assert (priv->parent_state_id == 0); - nm_assert (priv->parent_mtu_id == 0); + nm_assert (NM_DEVICE_MACSEC_GET_PRIVATE (self)->parent_state_id == 0); + nm_assert (NM_DEVICE_MACSEC_GET_PRIVATE (self)->parent_mtu_id == 0); } static const NMDBusInterfaceInfoExtended interface_info_device_macsec = { diff --git a/src/devices/nm-device-macvlan.c b/src/devices/nm-device-macvlan.c index 2f8c4c32cd..9079bb2b52 100644 --- a/src/devices/nm-device-macvlan.c +++ b/src/devices/nm-device-macvlan.c @@ -462,16 +462,18 @@ nm_device_macvlan_init (NMDeviceMacvlan *self) { } +#if NM_MORE_ASSERTS static void dispose (GObject *object) { - NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE (object); - G_OBJECT_CLASS (nm_device_macvlan_parent_class)->dispose (object); - nm_assert (priv->parent_state_id == 0); - nm_assert (priv->parent_mtu_id == 0); + nm_assert (NM_DEVICE_MACVLAN_GET_PRIVATE (object)->parent_state_id == 0); + nm_assert (NM_DEVICE_MACVLAN_GET_PRIVATE (object)->parent_mtu_id == 0); } +#else +#define dispose ((void (*) (GObject *object)) NULL) +#endif static const NMDBusInterfaceInfoExtended interface_info_device_macvlan = { .parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (