gio: Prevent hang writing to a large GMemoryBuffer
[platform/upstream/glib.git] / gio / gsettingsschema.c
index 5b996e1..a7e0838 100644 (file)
@@ -394,7 +394,7 @@ g_settings_schema_source_get_default (void)
  *
  * If the schema isn't found, %NULL is returned.
  *
- * Returns: (transfer full): a new #GSettingsSchema
+ * Returns: (nullable) (transfer full): a new #GSettingsSchema
  *
  * Since: 2.32
  **/
@@ -673,8 +673,9 @@ parse_into_text_tables (const gchar *directory,
           GMarkupParseContext *context;
 
           context = g_markup_parse_context_new (&parser, G_MARKUP_TREAT_CDATA_AS_TEXT, &info, NULL);
+          /* Ignore errors here, this is best effort only. */
           if (g_markup_parse_context_parse (context, contents, size, NULL))
-            g_markup_parse_context_end_parse (context, NULL);
+            (void) g_markup_parse_context_end_parse (context, NULL);
           g_markup_parse_context_free (context);
 
           /* Clean up dangling stuff in case there was an error. */
@@ -697,6 +698,8 @@ parse_into_text_tables (const gchar *directory,
 
       g_free (filename);
     }
+  
+  g_dir_close (dir);
 }
 
 static GHashTable **