scoped memory management
------------------------

                 Key: XERCESC-1730
                 URL: https://issues.apache.org/jira/browse/XERCESC-1730
             Project: Xerces-C++
          Issue Type: Improvement
            Reporter: Tobias Schuette
            Priority: Minor


passing scoped memory managers to certain helper functions (xercesc/util/...) 
only works in non-exceptional or catch-all circumstances.
If those functions (e.g. XMLString::parseInt) throw an exception the scoped 
memory manager
is passed via ThrowXMLwithMemMgrXXX to the exception during construction.
The exception allocates memory for its internal buffers (message/source file) 
from that memory manager.
If the exception is not caught before the scoped memory manager goes 
out-of-scope,
dereferencing/deallocating the memory during reporting/destruction yields 
undefined behaviour.

the attached diffs against trunk are a proposal to change the MemoryManager 
interface of Xerces-C's pluggable memory management and the exception base 
class XMLException in such a way that implementors of the MemoryManager 
interface are able to handle memory requests coming from exceptions separately 
as discussed on the mailing-list.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to