online-accounts: Small cleanup about resource releasing
Use g_clear_object() as a NULL-safe g_object_unref() and g_list_free_full() instead of explicitly iterating the list contents. https://bugzilla.gnome.org/show_bug.cgi?id=695877
This commit is contained in:
parent
d0d33205fa
commit
397181e5d2
2 changed files with 6 additions and 12 deletions
|
@ -250,8 +250,7 @@ goa_panel_add_account_dialog_finalize (GObject *object)
|
||||||
GoaPanelAddAccountDialog *add_account = GOA_PANEL_ADD_ACCOUNT_DIALOG (object);
|
GoaPanelAddAccountDialog *add_account = GOA_PANEL_ADD_ACCOUNT_DIALOG (object);
|
||||||
GoaPanelAddAccountDialogPrivate *priv = add_account->priv;
|
GoaPanelAddAccountDialogPrivate *priv = add_account->priv;
|
||||||
|
|
||||||
if (priv->error != NULL)
|
g_clear_error (&priv->error);
|
||||||
g_error_free (priv->error);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (goa_panel_add_account_dialog_parent_class)->finalize (object);
|
G_OBJECT_CLASS (goa_panel_add_account_dialog_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,12 +122,9 @@ cc_goa_panel_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
CcGoaPanel *panel = CC_GOA_PANEL (object);
|
CcGoaPanel *panel = CC_GOA_PANEL (object);
|
||||||
|
|
||||||
if (panel->accounts_model != NULL)
|
g_clear_object (&panel->accounts_model);
|
||||||
g_clear_object (&panel->accounts_model);
|
g_clear_object (&panel->client);
|
||||||
|
g_clear_object (&panel->builder);
|
||||||
if (panel->client != NULL)
|
|
||||||
g_object_unref (panel->client);
|
|
||||||
g_object_unref (panel->builder);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (cc_goa_panel_parent_class)->finalize (object);
|
G_OBJECT_CLASS (cc_goa_panel_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
@ -476,8 +473,7 @@ show_page_account (CcGoaPanel *panel,
|
||||||
|
|
||||||
gtk_widget_show_all (panel->accounts_vbox);
|
gtk_widget_show_all (panel->accounts_vbox);
|
||||||
|
|
||||||
if (provider != NULL)
|
g_clear_object (&provider);
|
||||||
g_object_unref (provider);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
@ -693,8 +689,7 @@ add_account (CcGoaPanel *panel)
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
g_list_foreach (providers, (GFunc) g_object_unref, NULL);
|
g_list_free_full (providers, g_object_unref);
|
||||||
g_list_free (providers);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue