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

Fix Trader memoryleak caused by OnFrame functions #5473

Merged

Conversation

Dullson
Copy link
Contributor

@Dullson Dullson commented Dec 27, 2022

Fixes #5472

Some PoB Trader modules are causing memory leaks by leaving OnFrame references behind in the main module.
This fix converts OnFrame subscription to be named, allowing the new class instantiation to replace the old OnFrame reference.

This doesn't solve the dangling reference problem altogether, we still hold one reference each to these classes which potentially prevents GC. Still, reserving memory for only one object is better than a growing memory leak.

Feel free to override if you implement proper lifecycle management.

@Dullson Dullson changed the title fix(pobtrader): memoryleak caused by unsubbed OnFrame functions Fix Trader memoryleak caused by OnFrame functions Dec 27, 2022
@QuickStick123 QuickStick123 added the bug Something isn't working label Dec 27, 2022
@LocalIdentity LocalIdentity merged commit cdd6fe2 into PathOfBuildingCommunity:dev Dec 28, 2022
@Dullson Dullson deleted the pobtrader_fix_onframe_leak branch December 28, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory Leak in trader
3 participants