Skip to content

Commit

Permalink
fix: reset resources in destructor to avoid memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
JJIngram authored and amaanq committed Jun 19, 2024
1 parent a90b361 commit d07a2ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class CallbackInput final {
}
}

~CallbackInput() {
callback.Reset();
partial_string.Reset();
}

TSInput Input() {
TSInput result;
result.payload = static_cast<void *>(this);
Expand Down

0 comments on commit d07a2ad

Please sign in to comment.