Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchors have a memory leak #822

Open
austinbhale opened this issue Dec 28, 2023 · 0 comments
Open

Anchors have a memory leak #822

austinbhale opened this issue Dec 28, 2023 · 0 comments

Comments

@austinbhale
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant