From bbc8f509b026de7bf69116e346e0964787e6d485 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Mon, 16 Sep 2024 22:00:18 +0800 Subject: [PATCH] Base: fix XMLReader non-closing character stream --- src/Base/Reader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Base/Reader.cpp b/src/Base/Reader.cpp index 2116afbed3..f172b18c78 100644 --- a/src/Base/Reader.cpp +++ b/src/Base/Reader.cpp @@ -181,6 +181,8 @@ bool Base::XMLReader::read() void Base::XMLReader::readElement(const char* ElementName) { bool ok {}; + + endCharStream(); int currentLevel = Level; std::string currentName = LocalName; do { @@ -248,6 +250,8 @@ bool Base::XMLReader::isEndOfDocument() const void Base::XMLReader::readEndElement(const char* ElementName, int level) { + endCharStream(); + // if we are already at the end of the current element if ((ReadType == EndElement || ReadType == StartEndElement) && ElementName && LocalName == ElementName && (level < 0 || level == Level)) {