[Ardour-Dev] Replacing property values in a Session State file.

Paul Davis paul at linuxaudiosystems.com
Sat Jan 26 14:56:02 PST 2008


On Sat, 2008-01-26 at 19:13 +0000, John Emmas wrote:
> Hi Paul,
> 
> Some time ago I reported this issue in Mantis:-
> 
> http://tracker.ardour.org/view.php?id=1809
> 
> It occurs in the pbd branch in libs/pbd/xml++.cpp.  Essentially, if you
> remove an XML property using XMLNode::remove_property() it isn't freeing up
> the memory that got allocated in the first place by XMLNode::add_property().
> I wondered if there should be a function 'remove_property_and_delete()'
> along the same lines as 'remove_nodes_and_delete()' ?   (or maybe
> 'XMLNode::remove_property()' should just free the memory anyway).
> 
> Also (in view of that problem) is there any way to change a property's value
> without re-using XMLNode::add_property() ?   I couldn't see anything like
> 'XMLNode::set_property()' or 'XMLNode::replace_property()' etc, but it never
> does any harm to ask....

the memory ownership model of libxml++, which is where xml++.cc comes
from, is very confused. i would be very cautious about doing anything to
it that involves any changes to the current memory model.

i would agree that the current code looks wrong and is at least rather
confusing. i don't know of anywhere in ardour that we would do property
replace though. do you have something in mind?

--p




More information about the Ardour-Dev mailing list