[gtk+] Fix a GtkBuilder crash



commit 45894c9fad16886bd9c97adca150dd693ba0c806
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 6 20:55:26 2009 -0400

    Fix a GtkBuilder crash
    
    Always set an error when returning FALSE from gtk_builder_value_from_string.
    This fixes the crash reported in bug 532858.
---
 gtk/gtkbuilder.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 1ea7db3..9dff20e 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -1329,7 +1329,14 @@ gtk_builder_value_from_string_type (GtkBuilder   *builder,
           g_value_take_boxed (value, vector);
         }
       else
-        ret = FALSE;
+        {
+          g_set_error (error,
+                       GTK_BUILDER_ERROR,
+                       GTK_BUILDER_ERROR_INVALID_VALUE,
+                       "Could not parse '%s' as a %s",
+                       string, G_VALUE_TYPE_NAME (value));
+          ret = FALSE;
+        }
       break;
     case G_TYPE_OBJECT:
       if (G_VALUE_HOLDS (value, GDK_TYPE_PIXBUF))



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