Using g_clear_object() instead of g_object_unref() in ag_window_set_chart

This commit is contained in:
Gergely Polonkai 2014-08-03 11:12:29 +02:00
parent 64bbe0fd68
commit 803b0211dd
2 changed files with 2 additions and 1 deletions

View File

@ -854,6 +854,7 @@ ag_chart_load_from_file(GFile *file, GError **err)
house_system_enum_name = g_utf8_strdown(house_system_name, -1);
g_free(house_system_name);
house_system_class = g_type_class_ref(GSWE_TYPE_HOUSE_SYSTEM);
if ((enum_value = g_enum_get_value_by_nick(
G_ENUM_CLASS(house_system_class),
house_system_enum_name

View File

@ -1233,7 +1233,7 @@ ag_window_set_chart(AgWindow *window, AgChart *chart)
chart_changed,
window
);
g_object_unref(priv->chart);
g_clear_object(&(priv->chart));
}
priv->chart = chart;