Skip to content

Commit

Permalink
Call reset on reusable SAXParser instance
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed Nov 11, 2024
1 parent e2b3913 commit 471170a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shared/src/main/scala/scala/xml/factory/XMLLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ trait XMLLoader[T <: Node] {
}

/* Override this to use a different SAXParser. */
def parser: SAXParser = parserInstance.get
def parser: SAXParser = {
val p = parserInstance.get
p.reset()
p
}

/* Override this to use a different XMLReader. */
def reader: XMLReader = parser.getXMLReader
Expand Down

0 comments on commit 471170a

Please sign in to comment.