+ terminate xerces at program exit

This commit is contained in:
wmayer 2016-03-09 15:52:42 +01:00
parent 6da5c23990
commit 2e43774c2f
5 changed files with 22 additions and 2 deletions

View File

@ -922,6 +922,7 @@ void Application::destruct(void)
ScriptFactorySingleton::Destruct();
InterpreterSingleton::Destruct();
Base::Type::destruct();
ParameterManager::Terminate();
}
void Application::destructObserver(void)

View File

@ -1062,6 +1062,13 @@ void ParameterManager::Init(void)
}
}
void ParameterManager::Terminate(void)
{
StrXUTF8::terminate();
XUTF8Str::terminate();
XMLPlatformUtils::Terminate();
}
//**************************************************************************
// Document handling

View File

@ -218,8 +218,6 @@ public:
std::vector<std::pair<std::string,std::string> > GetASCIIMap(const char * sFilter = NULL) const;
//@}
static void Init(void);
friend class ParameterManager;
/// returns the name
@ -278,6 +276,7 @@ public:
ParameterManager();
~ParameterManager();
static void Init(void);
static void Terminate(void);
int LoadDocument(const char* sFileName);
int LoadDocument(const XERCES_CPP_NAMESPACE_QUALIFIER InputSource&);

View File

@ -35,3 +35,12 @@ using namespace Base;
std::auto_ptr<XERCES_CPP_NAMESPACE::XMLTranscoder> StrXUTF8::transcoder;
std::auto_ptr<XERCES_CPP_NAMESPACE::XMLTranscoder> XUTF8Str::transcoder;
void StrXUTF8::terminate()
{
transcoder.reset();
}
void XUTF8Str::terminate()
{
transcoder.reset();
}

View File

@ -114,6 +114,8 @@ public :
/// string which holds the UTF-8 form
std::string str;
static void terminate();
private :
static std::auto_ptr<XERCES_CPP_NAMESPACE::XMLTranscoder> transcoder;
// This is the local code page form of the string.
@ -231,6 +233,8 @@ public :
/// Getter method
const XMLCh* unicodeForm() const;
static void terminate();
private :
std::basic_string<XMLCh> str;
static std::auto_ptr<XERCES_CPP_NAMESPACE::XMLTranscoder> transcoder;