From 1745fbc8feec44b064ef92cb0f1f78789342e311 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 2 Nov 2016 20:53:08 +0100 Subject: Fix bug:1013141 crash deleting LPE Fixed bugs: - https://launchpad.net/bugs/1013141 (bzr r15200) --- src/ui/dialog/livepatheffect-editor.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index b97b0e63a..4d60d610e 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -547,7 +547,17 @@ void LivePathEffectEditor::on_effect_selection_changed() if (lperef && current_lpeitem && current_lperef != lperef) { //The last condition ignore Gtk::TreeModel may occasionally be changed emitted when nothing has happened - if (lperef->lpeobject->get_lpe()) { + Glib::RefPtr model = effectlist_view.get_model(); + Gtk::TreeNodeChildren childs = model->children(); + Gtk::TreeNodeChildren::iterator row; + bool removed = true; + for( row = childs.begin() ; row!=childs.end(); ++row) + { + if ( (*row)[columns.lperef] == current_lperef ) { + removed = false; + } + } + if (!removed && lperef->lpeobject->get_lpe()) { lpe_list_locked = true; // prevent reload of the list which would lose selection current_lpeitem->setCurrentPathEffect(lperef); current_lperef = lperef; -- cgit v1.2.3