Base: fix XMLReader non-closing character stream

This commit is contained in:
Zheng, Lei
2024-09-16 22:00:18 +08:00
committed by Chris Hennes
parent a6975c8cef
commit 64ff5ac078

View File

@@ -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)) {