rogchap / v8go

Execute JavaScript from Go

Home Page:https://rogchap.com/v8go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Isolate dispose cause the memory leak

wwsheng009 opened this issue · comments

Isolate dispose cause the memory leak。

https://github.com/rogchap/v8go/blob/cee5f84bb54338bdef150b3e43daace4669c5de2/isolate.go#L147C1-L147C1

func (i *Isolate) Dispose() {
	if i.ptr == nil {
		return
	}
	C.IsolateDispose(i.ptr)
	i.ptr = nil
	i.cbs = nil //shoud release the cbs,otherwise the memory will leak。
}