diff --git a/src/store/naive/store.cpp b/src/store/naive/store.cpp --- a/src/store/naive/store.cpp +++ b/src/store/naive/store.cpp @@ -97,6 +97,8 @@ ********************************************************************************/ Store::Store() : + theEmptyNs(NULL), + theXmlSchemaNs(NULL), theNumUsers(0), theNamespacePool(NULL), theQNamePool(NULL), @@ -124,6 +126,8 @@ ********************************************************************************/ Store::~Store() { + delete theEmptyNs; + delete theXmlSchemaNs; } @@ -145,10 +149,13 @@ store::Properties::load(0, NULL); + theEmptyNs = new zstring; + theXmlSchemaNs = new zstring; + theNamespacePool = new StringPool(NAMESPACE_POOL_SIZE); - theNamespacePool->insertc("", theEmptyNs); - theNamespacePool->insertc(XS_URI, theXmlSchemaNs); + theNamespacePool->insertc("", *theEmptyNs); + theNamespacePool->insertc(XS_URI, *theXmlSchemaNs); theQNamePool = new QNamePool(QNamePool::MAX_CACHE_SIZE, theNamespacePool); @@ -333,8 +340,9 @@ if (theNamespacePool != NULL) { - theEmptyNs.~zstring(); - theXmlSchemaNs.~zstring(); + delete theEmptyNs; + delete theXmlSchemaNs; + theEmptyNs = theXmlSchemaNs = NULL; delete theNamespacePool; theNamespacePool = NULL; diff --git a/src/store/naive/store.h b/src/store/naive/store.h --- a/src/store/naive/store.h +++ b/src/store/naive/store.h @@ -148,8 +148,8 @@ static const ulong DEFAULT_INTEGRITY_CONSTRAINT_SET_SIZE; public: - zstring theEmptyNs; - zstring theXmlSchemaNs; + zstring *theEmptyNs; + zstring *theXmlSchemaNs; std::vector theSchemaTypeNames; std::map theSchemaTypeCodes;