mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 04:28:00 +02:00
wwan: disconnect modem signals when disposing NMDeviceModem
This commit is contained in:
parent
f8b4ee04ba
commit
d0c380ea68
1 changed files with 6 additions and 5 deletions
|
|
@ -468,14 +468,15 @@ get_property (GObject *object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
finalize (GObject *object)
|
||||
dispose (GObject *object)
|
||||
{
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
|
||||
|
||||
g_object_unref (priv->modem);
|
||||
priv->modem = NULL;
|
||||
if (priv->modem)
|
||||
g_signal_handlers_disconnect_by_data (priv->modem, NM_DEVICE_MODEM (object));
|
||||
g_clear_object (&priv->modem);
|
||||
|
||||
G_OBJECT_CLASS (nm_device_modem_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (nm_device_modem_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -487,7 +488,7 @@ nm_device_modem_class_init (NMDeviceModemClass *mclass)
|
|||
g_type_class_add_private (object_class, sizeof (NMDeviceModemPrivate));
|
||||
|
||||
/* Virtual methods */
|
||||
object_class->finalize = finalize;
|
||||
object_class->dispose = dispose;
|
||||
object_class->get_property = get_property;
|
||||
object_class->set_property = set_property;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue