xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16954] New: - There should be a way to release child nodes, once we done with it.(Patch Available)
Date Tue, 11 Feb 2003 06:12:18 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16954>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16954

There should be a way to release child nodes, once we done with it.(Patch Available)

           Summary: There should be a way to release child nodes, once we
                    done with it.(Patch Available)
           Product: Xerces-C++
           Version: 2.1.0
          Platform: All
        OS/Version: MacOS X
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: psahu@quark.co.in


We have classes derived from DOMNode. At any given point of time when we are 
having a DOMNode* , say nodePtr, with us we are not sure whether it points to 
a xerces node. We can't delete or release a xerces node unless its parent is 
released first.

So for xerces the rule is that one has to release the document in the end and 
then only all the child nodes are released/deleted. So as soon as you are done 
with that node you must delete it. 

This cannot be done with xerces node.So the solution opted is that an empty 
function dispose() added to interface DOMNode which has an empty mplementation 
in xerces. Now whenever we use a DOMNode* and we are done with it we can call 
dispose over it. If node belongs to xerces nothing happens whereas if its 
ours, it gets deleted. That's the basic idea.

Regarding the patch :

DOMNode.hpp contains empty function dispose().

DOMWriterImpl.cpp contains class DOMWriterImpl which implements the interface 
DOMWriter. So at places in DOMWriterImpl wherever we are done with DOMNode*, 
we call dispose over that. This is done so that when we use DOMWriter to act 
on DOM node, there are no memory leaks.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Mime
View raw message