This still crashes in the following situation:

make a region,
encapsulate it
save the file
close the file
open the file
go to the params dialog for the encapsulated region,
open the 'vertices' node
right-click 'vertex 001' and remove item (smart)

It seems that the crash doesn't happen if the region isn't
encapsulated, or if the region has been created this session, not read
from a file, or if the param dialog's 'vertices' node isn't opened.

The problem seems to be that the
canvas()->signal_value_node_child_removed() call when the vertex is
deleted isn't triggering the
LayerParamTreeStore::on_value_node_child_removed() method if the
region is encapsulated.

The existing code in valuenode_dynamiclist.cpp says this:

                                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())
                                        
get_root_canvas()->signal_value_node_child_removed()(this,value_node);

notice that the 'else' part can't ever be run.  I think that it's only
the root canvas which reacts to the signal we're sending.

This patch seems to fix things, but I'm left wondering what the
intention of the above code was.

--- synfig/src/synfig/valuenode_dynamiclist.cpp (revision 255)
+++ synfig/src/synfig/valuenode_dynamiclist.cpp (working copy)
@@ -525,9 +525,7 @@
                        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())
+                               if(get_root_canvas())
                                        
get_root_canvas()->signal_value_node_child_removed()(this,value_node);
                        }
                        break;

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to