[gtksourceview] Avoid race when repopulating the list box
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Avoid race when repopulating the list box
- Date: Wed, 31 Dec 2014 08:50:12 +0000 (UTC)
commit e3a252adea9321088884a8e2694469d5ddaa3090
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Dec 31 09:49:16 2014 +0100
Avoid race when repopulating the list box
Ensure we do not get the selected event when destroying the rows.
gtksourceview/gtksourcestyleschemechooserwidget.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcestyleschemechooserwidget.c
b/gtksourceview/gtksourcestyleschemechooserwidget.c
index c4b0998..b58632e 100644
--- a/gtksourceview/gtksourcestyleschemechooserwidget.c
+++ b/gtksourceview/gtksourcestyleschemechooserwidget.c
@@ -205,6 +205,8 @@ gtk_source_style_scheme_chooser_widget_populate (GtkSourceStyleSchemeChooserWidg
guint i;
gboolean row_selected = FALSE;
+ g_signal_handlers_block_by_func (priv->list_box, on_row_selected, widget);
+
gtk_container_foreach (GTK_CONTAINER (priv->list_box),
(GtkCallback)gtk_widget_destroy,
NULL);
@@ -226,14 +228,14 @@ gtk_source_style_scheme_chooser_widget_populate (GtkSourceStyleSchemeChooserWidg
if (scheme == priv->scheme)
{
- g_signal_handlers_block_by_func (priv->list_box, on_row_selected, widget);
gtk_list_box_select_row (priv->list_box, GTK_LIST_BOX_ROW (row));
- g_signal_handlers_unblock_by_func (priv->list_box, on_row_selected, widget);
row_selected = TRUE;
}
}
+ g_signal_handlers_unblock_by_func (priv->list_box, on_row_selected, widget);
+
/* The current scheme may have been removed so select the default one */
if (!row_selected)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]