Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.4.0
-
None
-
All platforms
Description
I may be misunderstanding how this should work, but GrammarResolver::resetCachedGrammar() clears the associated XMLGrammarPool instance, but does not clears its own cache of pooled grammars, stored in the member variable fGrammarFromPool. The result is a dangling pointer to a Grammar instance that no longer exists. I've applied the following patch to my local copy of Xerces-C, which seems to clear up the problem.
cvs diff GrammarResolver.cpp (in directory V:\xml-xerces\c\src\xercesc\validators\common)
Index: GrammarResolver.cpp
===================================================================
RCS file: /home/cvspublic/xml-xerces/c/src/xercesc/validators/common/GrammarResolver.cpp,v
retrieving revision 1.25
diff -r1.25 GrammarResolver.cpp
403a404
> fGrammarFromPool->removeAll();