From: dooglus Date: Fri, 1 Feb 2008 15:21:45 +0000 (+0000) Subject: Fix 1868911: exported canvases weren't being deleted, due to a handle never being... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=26ed1c813d50bee5c39b3cfc4401a0a41506edb8;p=synfig.git Fix 1868911: exported canvases weren't being deleted, due to a handle never being released. git-svn-id: http://svn.voria.com/code@1546 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp index 31f36ee..aa228eb 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp @@ -377,7 +377,18 @@ CanvasInterface::generate_param_list(const ValueDesc &value_desc) 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()) {