Skip to content

Commit

Permalink
Merge branch 'close-parse-on-stopped'
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglingsong committed Jul 21, 2021
2 parents a4a1c5b + f1cfd83 commit 8d28d6b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ private void doParse() {
if (tempString != null) {
context.primitive(staticPrimitiveHolder.withValue(tempString));
}

if (context.isStopped()) {
lexer.close();
}

} catch (Exception e) {
context.getConfig().getErrorHandlingStrategy().handleParsingException(e);
}
Expand Down
3 changes: 3 additions & 0 deletions jsurfer-gson/src/main/java/org/jsfr/json/GsonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ private void doParse() {
break;
}
}
if (context.isStopped()) {
jsonReader.close();
}
} catch (Exception e) {
context.getConfig().getErrorHandlingStrategy().handleParsingException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ void doPare() throws IOException {
throw new IllegalStateException("Unexpected token");
}
}
if (context.isStopped()) {
this.jsonParser.close();
}
}

}
Expand Down

0 comments on commit 8d28d6b

Please sign in to comment.