mirror of
https://github.com/janet-lang/janet
synced 2024-12-26 00:10:27 +00:00
Address #1263
Fix reference counting when cleaning up unused abstract types per-thread.
This commit is contained in:
parent
ca4c1e4259
commit
b7f8224588
@ -370,14 +370,15 @@ void janet_sweep() {
|
||||
if (head->type->gc) {
|
||||
janet_assert(!head->type->gc(head->data, head->size), "finalizer failed");
|
||||
}
|
||||
/* Free memory */
|
||||
janet_free(janet_abstract_head(abst));
|
||||
}
|
||||
|
||||
/* Mark as tombstone in place */
|
||||
items[i].key = janet_wrap_nil();
|
||||
items[i].value = janet_wrap_false();
|
||||
janet_vm.threaded_abstracts.deleted++;
|
||||
janet_vm.threaded_abstracts.count--;
|
||||
/* Free memory */
|
||||
janet_free(janet_abstract_head(abst));
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset for next sweep */
|
||||
|
Loading…
Reference in New Issue
Block a user