Skip to content
Snippets Groups Projects
Commit 9f1da4b4 authored by Neil Graham's avatar Neil Graham
Browse files

document seg fault that can be provoked by calling XMLPlatformUtils::Terminate...

document seg fault that can be provoked by calling XMLPlatformUtils::Terminate from within a catch block.


git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175138 13f79535-47bb-0310-9956-ffa450edef68
parent 0bcafbc8
No related branches found
No related tags found
No related merge requests found
......@@ -264,6 +264,19 @@ void myParsingFunction()
the parser object and destroy it explicitly before the
call to XMLPlatformUtils::Terminate() is made.
</p>
<p>Another way of producing segmentation faults--that again,
unfortunately, was employed by some of our
samples--is to have calls to XMLPlatformUtils::Terminate()
in a catch block that catches any of Xerces's exceptions.
Since the destructor of the exception will implicitly be
invoked upon exit from the catch block, and since some of
the exceptions' destructors call on Xerces's
default memory manager to destroy dynamically-allocated
objects, their destruction will provoke a segmentation
fault even if a return statement is placed in the catch
block since the default memory manager will no longer exist.
This practice is now avoided in all our samples.
</p>
</a>
</faq>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment