CanvasInterface::~CanvasInterface()
{
- synfig::info("synfigapp::CanvasInterface::~CanvasInterface(): Deleted");
+ if (getenv("SYNFIG_DEBUG_DESTRUCTORS"))
+ synfig::info("CanvasInterface::~CanvasInterface(): Deleted");
}
void
return 0;
}
- synfig::info("DEPTH=%d",depth);
+ // synfig::info("DEPTH=%d",depth);
+
// Action to move the layer (if necessary)
if(depth>0)
{
param_list.add("value_node",value_desc.get_value_node());
if(value_desc.is_const())
- param_list.add("value",value_desc.get_value());
+ {
+ // Fix 1868911: if we put a ValueBase holding a Canvas handle
+ // into the param_list and then export the canvas, the handle
+ // will miss out of having its reference count reduced,
+ // because by the time the handle is destructed the canvas
+ // will no longer be inline. So let's not propogate that
+ // ValueBase any further than here.
+ if (value_desc.get_value_type() == ValueBase::TYPE_CANVAS)
+ param_list.add("value",Canvas::LooseHandle(value_desc.get_value().get(Canvas::LooseHandle())));
+ else
+ param_list.add("value",value_desc.get_value());
+ }
if(value_desc.parent_is_layer_param())
{
void
CanvasInterface::waypoint_duplicate(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint)
{
+ ValueNode::Handle value_node();
+ waypoint_duplicate(value_desc.get_value_node(), waypoint);
+}
+
+void
+CanvasInterface::waypoint_duplicate(ValueNode::Handle value_node,synfig::Waypoint waypoint)
+{
Action::Handle action(Action::create("waypoint_set_smart"));
assert(action);
waypoint.make_unique();
waypoint.set_time(get_time());
- ValueNode::Handle value_node(value_desc.get_value_node());
-
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
action->set_param("waypoint",waypoint);
void
CanvasInterface::waypoint_remove(synfigapp::ValueDesc value_desc,synfig::Waypoint waypoint)
{
+ ValueNode::Handle value_node();
+ waypoint_remove(value_desc.get_value_node(), waypoint);
+}
+
+void
+CanvasInterface::waypoint_remove(ValueNode::Handle value_node,synfig::Waypoint waypoint)
+{
Action::Handle action(Action::create("waypoint_remove"));
assert(action);
if(!action)
return;
- ValueNode::Handle value_node(value_desc.get_value_node());
-
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",etl::loose_handle<CanvasInterface>(this));
action->set_param("waypoint",waypoint);