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

Memory leak due to Arc cycles #19

Closed
TheButlah opened this issue Apr 20, 2022 · 2 comments
Closed

Memory leak due to Arc cycles #19

TheButlah opened this issue Apr 20, 2022 · 2 comments

Comments

@TheButlah
Copy link

Hi, I've been reading through the codebase. It looks like SubsystemDescriptors hold Arc<SubsystemData>. And the SubsystemData holds the subsystem descriptors (without an Arc). Doesn't this mean that even if the parent subsystem is dropped, there will be a cyclic reference between a SubsystemDescriptor and a SubsystemData? So neither gets dropped and the memory is leaked

@TheButlah
Copy link
Author

Edit: I misunderstood what was happening. A SubsystemData holds its children's SubsystemDescriptors, not its own.

@Finomnis
Copy link
Owner

No problem, thanks for reporting anyway :)

I run a full LLVM leak detection in the CI to catch those corner cases, and so far they didn't complain :)

Working on a full rewrite though, that (hopefully) will make the code structure a little clearer and more extensible.

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

2 participants