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: prevent dangling references in dict and listCallbackProperties #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iisakkirotko
Copy link

Description

While implementing viewer closing in glue-jupyter, I found that ListCallbackProperty and DictCallbackProperty would often have a dangling references to instances of objects that use them. Using a weakref in referencing those objects will let them be garbage collected.

@dhomeier dhomeier added the bug label Jan 29, 2025
@dhomeier dhomeier closed this Jan 29, 2025
@dhomeier dhomeier reopened this Jan 29, 2025
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.70%. Comparing base (d4d9d2f) to head (864d9d8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #43   +/-   ##
=======================================
  Coverage   96.70%   96.70%           
=======================================
  Files          18       18           
  Lines        2274     2279    +5     
=======================================
+ Hits         2199     2204    +5     
  Misses         75       75           

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

@dhomeier
Copy link
Contributor

Thanks, implementation looks good, though I am not deeply familiar with the use case.

  1. Please rebase this as well to get the linux-ci tests.
  2. Could a test be added to test_containers.py to check the type the callback uses, or maybe even that garbage collection works?

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.

2 participants