You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/05/29 21:29:28 UTC

DO NOT REPLY [Bug 9502] New: - purify UMR in DocumentImpl::DocumentImpl

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=9502>.
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=9502

purify UMR in DocumentImpl::DocumentImpl

           Summary: purify UMR in DocumentImpl::DocumentImpl
           Product: Xerces-C++
           Version: 1.7.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: clarsen@inktomi.com


To fix UMR, move appendChild call to end of initialization. Here is patch.

Index: src/xercesc/dom/DocumentImpl.cpp
===================================================================
RCS file: /net/releng/export/releng/CVS_REPOSITORY/xdb_libs/xerces-c-src1_7_0/src/xercesc/dom/DocumentImpl.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -p -c -1 -0 -r1.1.1.1 -r1.2
*** src/xercesc/dom/DocumentImpl.cpp    16 Mar 2002 04:12:16 -0000      1.1.1.1
--- src/xercesc/dom/DocumentImpl.cpp    8 Apr 2002 07:19:19 -0000       1.2
*************** DocumentImpl::DocumentImpl()
*** 115,143 ****
  DocumentImpl::DocumentImpl(const DOMString &fNamespaceURI,
                             const DOMString &qualifiedName,
                             DocumentTypeImpl *doctype)
      : ParentNode(this)
  {
      docType=null;
  
        setDocumentType(doctype);
  
      docElement=null;
-     appendChild(createElementNS(fNamespaceURI, qualifiedName));  //root element
      namePool    = new DStringPool(257);
      iterators   = 0;
      treeWalkers = 0;
      fNodeIDMap  = 0;
      userData    = 0;
      ranges      = 0;
      fChanges = 0;
      errorChecking = true;
  }
  
  void DocumentImpl::setDocumentType(DocumentTypeImpl *doctype)
  {
        if (!doctype)
                return;
  
        if (doctype->getOwnerDocument() != null)
          throw DOM_DOMException(       //one doctype can belong to only one DocumentImpl
          DOM_DOMException::WRONG_DOCUMENT_ERR, null);
--- 115,143 ----
  DocumentImpl::DocumentImpl(const DOMString &fNamespaceURI,
                             const DOMString &qualifiedName,
                             DocumentTypeImpl *doctype)
      : ParentNode(this)
  {
      docType=null;
  
        setDocumentType(doctype);
  
      docElement=null;
      namePool    = new DStringPool(257);
      iterators   = 0;
      treeWalkers = 0;
      fNodeIDMap  = 0;
      userData    = 0;
      ranges      = 0;
      fChanges = 0;
      errorChecking = true;
+     appendChild(createElementNS(fNamespaceURI, qualifiedName));  //root element
  }
  
  void DocumentImpl::setDocumentType(DocumentTypeImpl *doctype)
  {
        if (!doctype)
                return;
  
        if (doctype->getOwnerDocument() != null)
          throw DOM_DOMException(       //one doctype can belong to only one DocumentImpl
          DOM_DOMException::WRONG_DOCUMENT_ERR, null);

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