View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001809 | ardour | bugs | public | 2007-08-04 07:23 | 2020-04-19 20:12 |
Reporter | johne53 | Assigned To | paul | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Summary | 0001809: [PATCH] Memory leak (may still be present in current version) | ||||
Description | When a property gets added to an XML Node using XMLNode::add_property(), a new XML property gets created at line 321 of xml++.cc - i.e. XMLProperty *tmp = new XMLProperty(ns, v); When the node gets deleted, it seems as if any memory allocated to properties also gets deleted (although I haven't traced through the code to find out how this happens). However, a property's memory only gets deleted as long as the property wasn't removed. If I remove the property using XMLNode::remove_property() its memory never seems to get deleted. I just wondered if XMLNode::remove_property() should be deleting any memory that was originally allocated by XMLNode::add_property() ? | ||||
Additional Information | I first reported this about 3 weeks ago via the Dev mailing list. I'm only reporting it again because I'm not sure if it got actioned. | ||||
Tags | No tags attached. | ||||
|
Paul - I implemented some code to fix this back in February and everything's worked fine since then. Would you like to have my changes? |
|
Yes please. |
|
Do you have those changes, John? |
|
Committed a fix to delete the XMLProperty in remove_property for A3 in revision 5824. Patch attached against 2.0. It's not particularly important as remove_property is only used in one place in Ardour, as far as I can see. Thanks for the report! |
2009-10-20 18:52
|
1809.patch (379 bytes)
diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 942727a..cf78ca5 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -340,7 +340,9 @@ void XMLNode::remove_property(const string & n) { if (_propmap.find(n) != _propmap.end()) { - _proplist.remove(_propmap[n]); + XMLProperty* p = _propmap[n]; + _proplist.remove (p); + delete p; _propmap.erase(n); } } |
|
committed to 2.X |
|
Issue has been closed automatically, by Trigger Close Plugin. Feel free to re-open with additional information if you think the issue is not resolved. |
Date Modified | Username | Field | Change |
---|---|---|---|
2007-08-04 07:23 | johne53 | New Issue | |
2008-06-14 17:29 | johne53 | Note Added: 0005023 | |
2008-06-16 01:55 | paul | Note Added: 0005026 | |
2009-10-20 09:25 | cth103 | Note Added: 0006762 | |
2009-10-20 09:25 | cth103 | Status | new => feedback |
2009-10-20 18:51 | cth103 | Note Added: 0006777 | |
2009-10-20 18:52 | cth103 | File Added: 1809.patch | |
2009-10-20 18:52 | cth103 | Status | feedback => assigned |
2009-10-20 18:52 | cth103 | Assigned To | => paul |
2009-10-20 18:52 | cth103 | cost | => 0.00 |
2009-10-20 18:52 | cth103 | Summary | Memory leak (may still be present in current version) => [PATCH] Memory leak (may still be present in current version) |
2009-10-30 17:22 | paul | Note Added: 0006997 | |
2009-10-30 17:22 | paul | Status | assigned => resolved |
2009-10-30 17:22 | paul | Resolution | open => fixed |
2020-04-19 20:12 | system | Note Added: 0021546 | |
2020-04-19 20:12 | system | Status | resolved => closed |