ComboBox: list: Don’t leak path on expand/collapse
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
This commit is contained in:
parent
b0e18d676e
commit
34cd1e3e5e
@ -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 */
|
/* 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),
|
gtk_tree_view_get_cell_area (GTK_TREE_VIEW (priv->tree_view),
|
||||||
path, column, &cell_area);
|
path, column, &cell_area);
|
||||||
if (x < cell_area.x || x >= cell_area.x + cell_area.width)
|
if (x >= cell_area.x && x < cell_area.x + cell_area.width)
|
||||||
return TRUE;
|
{
|
||||||
|
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
|
gtk_combo_box_popdown (combo_box);
|
||||||
* 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_tree_path_free (path);
|
gtk_tree_path_free (path);
|
||||||
|
|
||||||
gtk_combo_box_popdown (combo_box);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user