CanvasInterface::~CanvasInterface()
{
- synfig::info("synfigapp::CanvasInterface::~CanvasInterface(): Deleted");
+ if (getenv("SYNFIG_DEBUG_DESTRUCTORS"))
+ synfig::info("CanvasInterface::~CanvasInterface(): Deleted");
}
void
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())
{
{
x[0]=size[0];
x[1]=size[0]/w*h;
- if(size[0]<0 ^ size[1]<0)
+ if((size[0]<0) ^ (size[1]<0))
x[1]=-x[1];
}
else
{
x[1]=size[1];
x[0]=size[1]/h*w;
- if(size[0]<0 ^ size[1]<0)
+ if((size[0]<0) ^ (size[1]<0))
x[0]=-x[0];
}
if(!layer->set_param("tl",ValueBase(-x/2)))