core: reset GList pointers to NULL when necessary
When calling g_list_free_full() to free a GList in dispose(), it is necessary to reset the GList pointer to NULL as dispose() may be called more than once.
This commit is contained in:

committed by
Aleksander Morgado

parent
78e6ba5688
commit
27e4c74c60
@@ -395,6 +395,7 @@ dispose (GObject *object)
|
||||
|
||||
g_clear_object (&self->priv->modem);
|
||||
g_list_free_full (self->priv->list, g_object_unref);
|
||||
self->priv->list = NULL;
|
||||
|
||||
G_OBJECT_CLASS (mm_call_list_parent_class)->dispose (object);
|
||||
}
|
||||
|
@@ -647,7 +647,9 @@ dispose (GObject *object)
|
||||
|
||||
g_clear_object (&(self->priv->plugin));
|
||||
g_list_free_full (self->priv->port_probes, g_object_unref);
|
||||
self->priv->port_probes = NULL;
|
||||
g_list_free_full (self->priv->ignored_port_probes, g_object_unref);
|
||||
self->priv->ignored_port_probes = NULL;
|
||||
|
||||
clear_modem (self);
|
||||
|
||||
|
@@ -451,6 +451,7 @@ dispose (GObject *object)
|
||||
|
||||
g_clear_object (&self->priv->modem);
|
||||
g_list_free_full (self->priv->list, g_object_unref);
|
||||
self->priv->list = NULL;
|
||||
|
||||
G_OBJECT_CLASS (mm_sms_list_parent_class)->dispose (object);
|
||||
}
|
||||
|
Reference in New Issue
Block a user