Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Jul 29, 2024
1 parent e79f96b commit c1ae680
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions flutter/sherpa_onnx/lib/src/punctuation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,16 @@ class OfflinePunctuation {
?.call(ptr, textPtr) ??
nullptr;

calloc.free(textPtr);

if (p == nullptr) {
calloc.free(textPtr);
return '';
}

final ans = p.toDartString();

SherpaOnnxBindings.sherpaOfflinePunctuationFreeText?.call(p);

calloc.free(textPtr);

return ans;
}

Expand Down

0 comments on commit c1ae680

Please sign in to comment.