[gnome-control-center] common: Fix crash when filtering language list
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] common: Fix crash when filtering language list
- Date: Tue, 27 Mar 2012 11:51:32 +0000 (UTC)
commit ee3f0720f2a22c9e829ba114713bfaf5b97cc8e2
Author: Bastien Nocera <hadess hadess net>
Date: Tue Mar 27 13:44:44 2012 +0200
common: Fix crash when filtering language list
And it's still being populated. If the list gets filtered
while it's being populated, we would end up with a row with NULL
data, causing us to crash.
Make sure to hold the GDK threads lock when reading from the list,
to avoid racing with the insert code.
http://bugzilla.gnome.org/show_bug.cgi?id=672293
panels/common/cc-language-chooser.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index 6f8e9ff..b2f692d 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -46,10 +46,13 @@ cc_language_chooser_get_language (GtkWidget *chooser)
tv = (GtkTreeView *) g_object_get_data (G_OBJECT (chooser), "list");
selection = gtk_tree_view_get_selection (tv);
+
+ gdk_threads_enter ();
if (gtk_tree_selection_get_selected (selection, &model, &iter))
gtk_tree_model_get (model, &iter, LOCALE_COL, &lang, -1);
else
lang = NULL;
+ gdk_threads_leave ();
return lang;
}
@@ -245,7 +248,10 @@ filter_languages (GtkTreeModel *model,
return TRUE;
}
+ gdk_threads_enter ();
gtk_tree_model_get (model, iter, DISPLAY_LOCALE_COL, &locale, -1);
+ gdk_threads_leave ();
+
l = g_utf8_casefold (locale, -1);
visible = strstr (l, filter_string) != NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]