gojs: gc fix refcount issue (#845)

Signed-off-by: Robbert van Ginkel <570934+robbertvanginkel@users.noreply.github.com>
This commit is contained in:
Robbert van Ginkel
2022-11-08 02:22:29 -05:00
committed by GitHub
parent 483dfe17c3
commit ac5ec317a7
4 changed files with 29 additions and 0 deletions

View File

@@ -195,6 +195,10 @@ func (j *values) increment(v interface{}) uint32 {
}
func (j *values) decrement(id uint32) {
// Special IDs are not refcounted.
if id < nextID {
return
}
id -= nextID
j.goRefCounts[id]--
if j.goRefCounts[id] == 0 {