Skip to content
Open
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
5 changes: 2 additions & 3 deletions Lib/vanilla/vanillaBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,8 @@ def _breakCycles(view):
"""
Break cyclic references by deleting _target attributes.
"""
if hasattr(view, "vanillaWrapper"):
if view.respondsToSelector_("vanillaWrapper"):
obj = view.vanillaWrapper()
if hasattr(obj, "_breakCycles"):
obj._breakCycles()
obj._breakCycles()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the vanillaWrapper object could be None, fe when weakref has no reference of that object anymore

testing if obj is not None: will not slow down breakCycles

for view in view.subviews():
_breakCycles(view)