summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Gustin <cedric.gustin@swing.be>2005-02-23 08:14:18 +0000
committerCedric Gustin <gustin@src.gnome.org>2005-02-23 08:14:18 +0000
commit7b66d2047b69d72ea1cf5a18fd44147ca3e3d4ad (patch)
treeb203e5405c3c2c29f33876eebb5648bc82280daf
parent7fe42b5b199f1db403a7fdfeb98c907b913664b3 (diff)
downloadpygtk-7b66d2047b69d72ea1cf5a18fd44147ca3e3d4ad.tar.gz
Do not use g_string_append_printf with a NULL argument, as it crashes on
2005-02-23 Cedric Gustin <cedric.gustin@swing.be> * gobject/pygtype.c (add_property_docs): Do not use g_string_append_printf with a NULL argument, as it crashes on win32. Fixes bug #166546.
-rw-r--r--ChangeLog6
-rw-r--r--gobject/pygtype.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 17162f74..25465946 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-02-23 Cedric Gustin <cedric.gustin@swing.be>
+
+ * gobject/pygtype.c (add_property_docs): Do not use
+ g_string_append_printf with a NULL argument, as it crashes on
+ win32. Fixes bug #166546.
+
2005-01-18 Gustavo J. A. M. Carneiro <gjc@gnome.org>
* gtk/gtkmodule.c (init_gtk): On Python >= 2.4, don't call
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index 2317fb31..7f1a9e0d 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -1020,6 +1020,7 @@ add_property_docs(GType gtype, GString *string)
GParamSpec **props;
guint n_props = 0, i;
gboolean has_prop = FALSE;
+ gchar *blurb=NULL;
class = g_type_class_ref(gtype);
props = g_object_class_list_properties(class, &n_props);
@@ -1038,8 +1039,12 @@ add_property_docs(GType gtype, GString *string)
g_param_spec_get_name(props[i]),
g_type_name(props[i]->value_type),
g_param_spec_get_nick(props[i]));
- g_string_append_printf(string, " %s\n",
- g_param_spec_get_blurb(props[i]));
+
+ /* g_string_append_printf crashes on win32 if the third
+ argument is NULL. */
+ blurb=g_param_spec_get_blurb(props[i]);
+ if (blurb)
+ g_string_append_printf(string, " %s\n",blurb);
}
g_free(props);
if (has_prop)