llcppsigfetch:json memory free

This commit is contained in:
luoliwoshang
2024-08-20 18:06:01 +08:00
parent 2974b23f26
commit 5e5c84ba27
2 changed files with 12 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package cvttest
import (
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse"
)
@@ -20,9 +21,12 @@ func RunTest(testName string, testCases []string) {
panic(err)
}
json := converter.MarshalASTFiles()
c.Printf(c.Str("%s Case %d:\n%s\n\n"), c.AllocaCStr(testName), c.Int(i+1), json.Print())
result := converter.MarshalASTFiles()
str := result.Print()
c.Printf(c.Str("%s Case %d:\n%s\n\n"), c.AllocaCStr(testName), c.Int(i+1), str)
cjson.FreeCStr(str)
result.Delete()
converter.Dispose()
}
}