Skip to content

Commit

Permalink
[gsettings.cpp] g_settings_schema_unref after g_object_get
Browse files Browse the repository at this point in the history
g_object_get may be reffing the schema which prevents it freeing.
  • Loading branch information
christopherlam committed Jul 1, 2023
1 parent 0d326fa commit 9dfe223
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libgnucash/app-utils/gnc-gsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ static bool gnc_gsettings_is_valid_key(GSettings *settings, const gchar *key)
auto keys = g_settings_schema_list_keys (schema);
auto found = (keys && g_strv_contains(keys, key));
g_strfreev (keys);
g_settings_schema_unref (schema);

return found;
}
Expand All @@ -87,6 +88,7 @@ static GSettings * gnc_gsettings_get_settings_obj (const gchar *schema_str)
g_free(full_name);

LEAVE("");
g_settings_schema_unref (schema);
return gset;
}

Expand Down Expand Up @@ -472,6 +474,7 @@ gnc_gsettings_reset_schema (const gchar *schema_str)
}

g_object_unref (gs_obj);
g_settings_schema_unref (schema);
g_strfreev (keys);
}

Expand Down

0 comments on commit 9dfe223

Please sign in to comment.