gtk+ r20477 - in trunk: . gtk
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r20477 - in trunk: . gtk
- Date: Fri, 20 Jun 2008 10:00:40 +0000 (UTC)
Author: mitch
Date: Fri Jun 20 10:00:40 2008
New Revision: 20477
URL: http://svn.gnome.org/viewvc/gtk+?rev=20477&view=rev
Log:
2008-06-20 Michael Natterer <mitch imendio com>
Bug 538395 â gtk_combo_box_append_text() on non-compliant model
segfaults
* gtk/gtkcombobox.c (gtk_combo_box_append_text)
(gtk_combo_box_insert_text)
(gtk_combo_box_prepend_text)
(gtk_combo_box_remove_text)
(gtk_combo_box_real_get_active_text): apply patch from Christian
Dywan which adds the needed g_return_if_fail() to prevent the
crashes.
Modified:
trunk/ChangeLog
trunk/gtk/gtkcombobox.c
Modified: trunk/gtk/gtkcombobox.c
==============================================================================
--- trunk/gtk/gtkcombobox.c (original)
+++ trunk/gtk/gtkcombobox.c Fri Jun 20 10:00:40 2008
@@ -5023,6 +5023,8 @@
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
g_return_if_fail (GTK_IS_LIST_STORE (combo_box->priv->model));
+ g_return_if_fail (gtk_tree_model_get_column_type (combo_box->priv->model, 0)
+ == G_TYPE_STRING);
g_return_if_fail (text != NULL);
store = GTK_LIST_STORE (combo_box->priv->model);
@@ -5054,6 +5056,8 @@
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
g_return_if_fail (GTK_IS_LIST_STORE (combo_box->priv->model));
g_return_if_fail (position >= 0);
+ g_return_if_fail (gtk_tree_model_get_column_type (combo_box->priv->model, 0)
+ == G_TYPE_STRING);
g_return_if_fail (text != NULL);
store = GTK_LIST_STORE (combo_box->priv->model);
@@ -5082,6 +5086,8 @@
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
g_return_if_fail (GTK_IS_LIST_STORE (combo_box->priv->model));
+ g_return_if_fail (gtk_tree_model_get_column_type (combo_box->priv->model, 0)
+ == G_TYPE_STRING);
g_return_if_fail (text != NULL);
store = GTK_LIST_STORE (combo_box->priv->model);
@@ -5109,6 +5115,8 @@
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
g_return_if_fail (GTK_IS_LIST_STORE (combo_box->priv->model));
+ g_return_if_fail (gtk_tree_model_get_column_type (combo_box->priv->model, 0)
+ == G_TYPE_STRING);
g_return_if_fail (position >= 0);
store = GTK_LIST_STORE (combo_box->priv->model);
@@ -5153,6 +5161,8 @@
gchar *text = NULL;
g_return_val_if_fail (GTK_IS_LIST_STORE (combo_box->priv->model), NULL);
+ g_return_val_if_fail (gtk_tree_model_get_column_type (combo_box->priv->model, 0)
+ == G_TYPE_STRING, NULL);
if (gtk_combo_box_get_active_iter (combo_box, &iter))
gtk_tree_model_get (combo_box->priv->model, &iter,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]