Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1216

GrammarResolver never clears internal cache of Grammar instances

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.4.0
    • 2.5.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();

      Attachments

        Activity

          People

            neilg@ca.ibm.com Neil Graham
            dbertoni David N Bertoni
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: