sciter-sdk / go-sciter

Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
https://sciter.com
2.57k stars 268 forks source link

Memleaks in sciter calls #205

Open regiMario opened 5 years ago

regiMario commented 5 years ago

The following file leaks memory for 10 seconds and never returns it. bang.go.txt

The following variant leaks just as much for range myTicker.C { str := strings.Repeat("x", 1024*1024) mainWin.Call("bang", sciter.NewValue(str)) }

Please advise if the error was between keyboard and chair.

big-hippo commented 4 years ago

my prog call sciter func in more than one go func{}() with v0.5.0 i release the value manually to prevent memory leak, but it hang about call more than 1000 times

using #207 the prog hang soon on windows, i think there is something wrong in copy-release

big-hippo commented 4 years ago

sorry, i think i found the reason. CallFunction must not call in goroutine, i call the same function in more than 16 go func{}(), then i got hang.