Skip to content

Commit

Permalink
fix: AddPunct panic for Go(#1921)
Browse files Browse the repository at this point in the history
  • Loading branch information
xcel3011 authored Feb 25, 2025
1 parent 0dcaf3a commit b042f5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/go/sherpa_onnx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ func DeleteOfflinePunc(punc *OfflinePunctuation) {

func (punc *OfflinePunctuation) AddPunct(text string) string {
p := C.SherpaOfflinePunctuationAddPunct(punc.impl, C.CString(text))
defer C.free(unsafe.Pointer(p))
defer C.SherpaOfflinePunctuationFreeText(p)

text_with_punct := C.GoString(p)

Expand Down

0 comments on commit b042f5e

Please # to comment.