From 9dcfbc55b2b1ae04e4800d939bf076b692b8eccf Mon Sep 17 00:00:00 2001 From: dooglus Date: Wed, 14 Mar 2007 19:58:01 +0000 Subject: [PATCH] Fix 1420091: Crash when deleting vertex items. I don't think this is the right fix, but it seems to stop the crash at least. git-svn-id: http://svn.voria.com/code@314 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp b/synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp index a93a752..88e82cb 100644 --- a/synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_dynamiclist.cpp @@ -525,9 +525,17 @@ ValueNode_DynamicList::erase(const ValueNode::Handle &value_node_) if(value_node) { remove_child(value_node.get()); - if(get_parent_canvas()) - get_parent_canvas()->signal_value_node_child_removed()(this,value_node); - else if(get_root_canvas() && get_parent_canvas()) + // changed to fix bug 1420091 - it seems that when a .sif file containing a bline layer encapsulated inside + // another layer, get_parent_canvas() is false and get_root_canvas() is true, but when we come to erase a + // vertex, both are true. So the signal is sent to the parent, but the signal wasn't sent to the parent + // when it was added. This probably isn't the right fix, but it seems to work for now. Note that the same + // strange "if (X) else if (Y && X)" code is also present in the two previous functions, above. + + // if(get_parent_canvas()) + // get_parent_canvas()->signal_value_node_child_removed()(this,value_node); + // else if(get_root_canvas() && get_parent_canvas()) + // get_root_canvas()->signal_value_node_child_removed()(this,value_node); + if(get_root_canvas()) get_root_canvas()->signal_value_node_child_removed()(this,value_node); } break; -- 2.7.4