From 4d2099a9d250e2fbcd86479af9341451119cd60e Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Sat, 14 Sep 2019 21:55:14 +0800 Subject: [PATCH] Fix a crash --- src/wrapxerces.cpp | 5 ++++- src/xercesnetaccessor.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wrapxerces.cpp b/src/wrapxerces.cpp index b7a50d2..9256d97 100644 --- a/src/wrapxerces.cpp +++ b/src/wrapxerces.cpp @@ -56,7 +56,10 @@ void WrapXerces::Init ( bool enableNetAccess ) throw() } ~Initializer() { - delete mOriginalNetAccessor; + if ( mOriginalNetAccessor != NULL ) { + XMLPlatformUtils::fgNetAccessor = ( ( XercesNetAccessor * ) mOriginalNetAccessor )->getNetAccessor(); + delete mOriginalNetAccessor; + } XMLPlatformUtils::Terminate(); } } dummy; diff --git a/src/xercesnetaccessor.h b/src/xercesnetaccessor.h index d45ac2f..fbcdc12 100644 --- a/src/xercesnetaccessor.h +++ b/src/xercesnetaccessor.h @@ -30,6 +30,8 @@ class XercesNetAccessor : public XMLNetAccessor public: XercesNetAccessor ( XMLNetAccessor *netAccesor ); + XMLNetAccessor *getNetAccessor() const { return mNetAccessor; } + virtual const XMLCh *getId() const; virtual BinInputStream *makeNew ( const XMLURL &urlSrc,