Skip to content

Add weakref-based AutoUnload class to allow instances to be garbage collected #126

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

Merged
merged 7 commits into from
May 18, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update WeakAutoUnload doc string.
  • Loading branch information
jsza committed May 17, 2016
commit e9676fe8ae17d4cfabc47bbc298dcd2966b33186
4 changes: 1 addition & 3 deletions addons/source-python/packages/source-python/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ def _unload_instance(self):


class WeakAutoUnload(AutoUnload):
"""Subclass of AutoUnload used to unload specific instances when all
references to the instance are deleted.
"""
"""Subclass of AutoUnload used to store weak references to instances."""

# Create a dictionary to store AutoUnload objects in
_module_instances = defaultdict(WeakValueDictionary)
Expand Down