From 34cd1e3e5e483a000f102569abb6ecdce161f829 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Thu, 5 Oct 2017 01:31:39 +0100 Subject: [PATCH] =?UTF-8?q?ComboBox:=20list:=20Don=E2=80=99t=20leak=20path?= =?UTF-8?q?=20on=20expand/collapse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Determining that we clicked on the expander means that we had a valid path, so we still need to free that, even though we’re not selecting it. https://bugzilla.gnome.org/show_bug.cgi?id=788505 --- gtk/gtkcombobox.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 23fc10ea50..d001c5c0af 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -3187,21 +3187,21 @@ gtk_combo_box_list_button_released (GtkWidget *widget, /* Don’t select/close after clicking row’s expander. cell_area excludes that */ gtk_tree_view_get_cell_area (GTK_TREE_VIEW (priv->tree_view), path, column, &cell_area); - if (x < cell_area.x || x >= cell_area.x + cell_area.width) - return TRUE; + if (x >= cell_area.x && x < cell_area.x + cell_area.width) + { + gtk_tree_model_get_iter (priv->model, &iter, path); - gtk_tree_model_get_iter (priv->model, &iter, path); + /* Use iter before popdown, as mis-users like GtkFileChooserButton alter the + * model during notify::popped-up, which means the iterator becomes invalid. + */ + if (tree_column_row_is_sensitive (combo_box, &iter)) + gtk_combo_box_set_active_internal (combo_box, path); - /* Use iter before popdown, as mis-users like GtkFileChooserButton alter the - * model during notify::popped-up, which means the iterator becomes invalid. - */ - if (tree_column_row_is_sensitive (combo_box, &iter)) - gtk_combo_box_set_active_internal (combo_box, path); + gtk_combo_box_popdown (combo_box); + } gtk_tree_path_free (path); - gtk_combo_box_popdown (combo_box); - return TRUE; }