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/12/16 09:16:53 UTC

DO NOT REPLY [Bug 15386] New: - XMLString should provide release method

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

XMLString should provide release method

           Summary: XMLString should provide release method
           Product: Xerces-C++
           Version: 2.1.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Utilities
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: smartnoho@yahoo.com


When xerces is build as DLL, client can not release XMLCh * alloc by xerces.
The following is some code whicl will fault.

XMLCh * str = XMLString::transcode("test");
delete [] str;

str is alloc in xerces-DLL, but is free in client. The delete operator will 
fault.

So my suggestion is add 'release' method to class XMLString.
     /** Release the string memory
      *
      * @param toRelease The buffer that will need to be release.
      */
    static void release
    (
        XMLCh* toRelease
    );

inline void XMLString::release(XMLCh * toRelease)
{
	delete [] toRelease;
}

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