Commit 1fa01459 authored by Ell's avatar Ell

Bug 792991 - Crash when undoing a paste while naming pasted layer

When removing a GimpContainerTreeStore item, make sure that editing
of corresponding tree-view rows is canceled first, by emitting a
"row-changed" signal.  Otherwise, we can run into trouble when
removing an item that is being edited.

(cherry picked from commit 7bfab715)
parent 1a5c80f7
......@@ -300,13 +300,25 @@ gimp_container_tree_store_remove_item (GimpContainerTreeStore *store,
if (iter)
GtkTreeModel *model = GTK_TREE_MODEL (store);
GtkTreePath *path;
/* emit a "row-changed" signal for 'iter', so that editing of
* corresponding tree-view rows is canceled. otherwise, if we remove the
* item while a corresponding row is being edited, bad things happen (see
* bug #792991).
path = gtk_tree_model_get_path (model, iter);
gtk_tree_model_row_changed (model, path, iter);
gtk_tree_path_free (path);
gtk_tree_store_remove (GTK_TREE_STORE (store), iter);
/* If the store is empty after this remove, clear out renderers
* from all cells so they don't keep refing the viewables
* (see bug #149906).
if (! gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL))
if (! gtk_tree_model_iter_n_children (model, NULL))
GimpContainerTreeStorePrivate *private = GET_PRIVATE (store);
GList *list;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment