[ 
https://issues.apache.org/jira/browse/XERCESC-1730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578471#action_12578471
 ] 

James Berry commented on XERCESC-1730:
--------------------------------------

I'd be in favor of seeing this patch applied to 3.0. It's small, enables a 
useful behavior, and defers the cost of that behavior (an extra virtual 
function call in the best case) to when an exception is actually created, which 
should be an exceptional condition.

> 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
>             Fix For: 3.0.0
>
>         Attachments: MemoryManager.diff, XMLException.diff
>
>
> 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