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: Fix nested events inside loops leaking memory by referencing the previous 'event_data' when calling the next event on queue #485

Merged
merged 3 commits into from
Nov 1, 2024

Conversation

fgmacedo
Copy link
Owner

@fgmacedo fgmacedo commented Oct 28, 2024

Closes #484.

The event_data parameter references the EventDataclass. That is passed as kwargs to callbacks that accept this parameter... but all event triggers also accept event_data, so after the first loop, the new event receives the previous event_data and stores it's reference, making a chain of references for each iteration.

Fixed by removing the reference for know kwargs names generated by EventData.

@fgmacedo fgmacedo added the bug label Oct 28, 2024
@fgmacedo fgmacedo mentioned this pull request Oct 28, 2024
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (25d6392) to head (a2f5902).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop      #485   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1417      1419    +2     
  Branches       220       220           
=========================================
+ Hits          1417      1419    +2     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fgmacedo fgmacedo changed the title fix: Fix recursion leaking memory by referencing the previous 'event_data' when calling the next event on queue fix: Fix nested events inside loops leaking memory by referencing the previous 'event_data' when calling the next event on queue Oct 28, 2024
@fgmacedo fgmacedo force-pushed the macedo/fix-recursion-leaking-memory branch from be364ff to a2f5902 Compare October 28, 2024 20:54
Copy link

@fgmacedo fgmacedo merged commit ff14d62 into develop Nov 1, 2024
15 checks passed
@fgmacedo fgmacedo deleted the macedo/fix-recursion-leaking-memory branch November 1, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

State Recursion
1 participant