StereoKit
StereoKit copied to clipboard
Anchors have a memory leak
By the time an anchor is created, it already has 3 references.
assets_allocate +1
anchor_addref +1
anchor_mark_dirty +1, -1 (this one's good since it gets released at the end of every step)
then for MSFT anchors, an additional:
anchor_addref +1
Whenever the garbage collector in C# calls assets_releaseref_threadsafe,
it decrements the reference count. For MSFT anchors this goes from 3 -> 2 and for regular anchors 2 -> 1. It persists in memory in the lists and never receives a call to its anchor_destroy method since the reference count never gets to 0. Lmk if you'd like any more debugging info, thanks!