Skip to content

Commit

Permalink
Base: fix XMLReader non-closing character stream
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed Sep 16, 2024
1 parent 79c6949 commit 01f3037
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Base/Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 01f3037

Please sign in to comment.