From a01b1332773a85354df3c6af3a115f12118d888c Mon Sep 17 00:00:00 2001
From: Alberto Massari <amassari@apache.org>
Date: Thu, 2 Sep 2004 14:13:13 +0000
Subject: [PATCH] If getXSModel was invoked when schema caching was off and
 nothing had changed, a new (empty) model was created even if a non-empty one
 was already available

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@176018 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/validators/common/GrammarResolver.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/xercesc/validators/common/GrammarResolver.cpp b/src/xercesc/validators/common/GrammarResolver.cpp
index 8839809e0..6e5d52d24 100644
--- a/src/xercesc/validators/common/GrammarResolver.cpp
+++ b/src/xercesc/validators/common/GrammarResolver.cpp
@@ -57,6 +57,9 @@
 
 /*
  * $Log$
+ * Revision 1.27  2004/09/02 14:13:13  amassari
+ * If getXSModel was invoked when schema caching was off and nothing had changed, a new (empty) model was created even if a non-empty one was already available
+ *
  * Revision 1.26  2004/05/21 15:19:16  peiyongz
  * [jira1216]  GrammarResolver never clears internal cache of
  * Grammar instances -- patch from David Bertoni
@@ -567,8 +570,9 @@ XSModel *GrammarResolver::getXSModel()
         fGrammarsToAddToXSModel->removeAllElements();
         fXSModel = xsModel;             
     }
-    else
+    else if (!fXSModel)
     {
+        // create a new model only if we didn't have one already
         fXSModel = new (fMemoryManager) XSModel(0, this, fMemoryManager);
     }
     return fXSModel; 
-- 
GitLab