[gtk/matthiasc/for-main] builder: Use GMarkup properly




commit f991428cb95986eb3a1a80eeacc19ec9a051887f
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Dec 13 23:35:25 2021 -0500

    builder: Use GMarkup properly
    
    We must call end_parse to ensure we get errors
    for incomplete documents.

 gtk/gtkbuilderprecompile.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkbuilderprecompile.c b/gtk/gtkbuilderprecompile.c
index 0e613ad542..74551bb62e 100644
--- a/gtk/gtkbuilderprecompile.c
+++ b/gtk/gtkbuilderprecompile.c
@@ -321,10 +321,10 @@ _gtk_buildable_parser_precompile (const char  *text,
   data.root = record_data_tree_new (NULL, RECORD_TYPE_ELEMENT, NULL);
   data.current = data.root;
 
-  ctx = g_markup_parse_context_new (&record_parser, G_MARKUP_TREAT_CDATA_AS_TEXT,
-                                    &data, NULL);
+  ctx = g_markup_parse_context_new (&record_parser, G_MARKUP_TREAT_CDATA_AS_TEXT, &data, NULL);
 
-  if (!g_markup_parse_context_parse (ctx, text, text_len, error))
+  if (!g_markup_parse_context_parse (ctx, text, text_len, error) ||
+      !g_markup_parse_context_end_parse (ctx, error))
     {
       record_data_tree_free (data.root);
       g_hash_table_destroy (data.strings);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]