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:
Ben Chan
2017-03-28 23:23:14 -07:00
committed by Aleksander Morgado
parent 78e6ba5688
commit 27e4c74c60
3 changed files with 4 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);
}