[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-cvs
Subject:    cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMDocumentImpl.cpp
From:       gareth () apache ! org
Date:       2003-05-29 11:57:58
[Download RAW message or body]

gareth      2003/05/29 04:57:57

  Modified:    c/src/xercesc/dom/impl DOMDocumentImpl.cpp
  Log:
  Fix to bug #16817. Non leaf nodes and attributes now get notified of release. Patch by Nathan Codding.
  
  Revision  Changes    Path
  1.44      +14 -9     xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp
  
  Index: DOMDocumentImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- DOMDocumentImpl.cpp	23 May 2003 17:07:41 -0000	1.43
  +++ DOMDocumentImpl.cpp	29 May 2003 11:57:57 -0000	1.44
  @@ -1327,16 +1327,21 @@
   void DOMDocumentImpl::releaseDocNotifyUserData(DOMNode* object)
   {
       DOMNode *child = object->getFirstChild();
  -    if (child != 0)
  +    
  +    while( child != 0)
       {
  -        while( child != 0)
  -        {
  -            releaseDocNotifyUserData(child);
  -            child = child->getNextSibling();
  -        }
  +            
  +         DOMNamedNodeMap *attrlist=child->getAttributes(); 
  +    
  +         if(attrlist!=0) 
  +             for(XMLSize_t i=0;i<attrlist->getLength();++i) 
  +                 releaseDocNotifyUserData(attrlist->item(i)); 
  +            
  +        releaseDocNotifyUserData(child);
  +        child = child->getNextSibling();
       }
  -    else
  -        castToNodeImpl(object)->callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
  +
  +    castToNodeImpl(object)->callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
   }
   
   void DOMDocumentImpl::release(DOMNode* object, NodeObjectType type)
  
  
  

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic