GSettingsSchema: store a backref to the source
authorRyan Lortie <desrt@desrt.ca>
Sat, 26 Oct 2013 22:50:39 +0000 (18:50 -0400)
committerRyan Lortie <desrt@desrt.ca>
Sun, 27 Oct 2013 16:32:10 +0000 (09:32 -0700)
Record in each GSettingsSchema object the source from which it came.

This will be useful in future commits.

https://bugzilla.gnome.org/show_bug.cgi?id=668232

gio/gsettingsschema.c

index 26b6d48..cac5f71 100644 (file)
  **/
 struct _GSettingsSchema
 {
  **/
 struct _GSettingsSchema
 {
+  GSettingsSchemaSource *source;
   const gchar *gettext_domain;
   const gchar *path;
   GQuark *items;
   const gchar *gettext_domain;
   const gchar *path;
   GQuark *items;
@@ -412,6 +413,7 @@ g_settings_schema_source_lookup (GSettingsSchemaSource *source,
     return NULL;
 
   schema = g_slice_new0 (GSettingsSchema);
     return NULL;
 
   schema = g_slice_new0 (GSettingsSchema);
+  schema->source = g_settings_schema_source_ref (source);
   schema->ref_count = 1;
   schema->id = g_strdup (schema_id);
   schema->table = table;
   schema->ref_count = 1;
   schema->id = g_strdup (schema_id);
   schema->table = table;
@@ -588,6 +590,7 @@ g_settings_schema_unref (GSettingsSchema *schema)
 {
   if (g_atomic_int_dec_and_test (&schema->ref_count))
     {
 {
   if (g_atomic_int_dec_and_test (&schema->ref_count))
     {
+      g_settings_schema_source_unref (schema->source);
       gvdb_table_unref (schema->table);
       g_free (schema->items);
       g_free (schema->id);
       gvdb_table_unref (schema->table);
       g_free (schema->items);
       g_free (schema->id);