Skip to content

Conversation

typesupply
Copy link
Member

This addresses #145.

Closing the test window in the issue goes from taking 0.11 seconds to 0.01 seconds.

This addresses #145.

Closing the test window in the issue goes from taking 0.11 seconds to 0.01 seconds.
@typesupply
Copy link
Member Author

@typemytype @justvanrossum Could one of you double check that I'm not making a mistake here. I'm 99% sure it is okay, but since this will affect every vanilla window ever, I'd like another pair of eyes on it.

@typemytype
Copy link
Member

looks fine! the callback should only be used with nsObject (vanilla contentViews)

approved +1

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

Suggested by @typemytype in #200.
I don't know why any NSObject would be set as "vanillaWrapper" so remove this test.
@benkiel
Copy link
Member

benkiel commented Apr 9, 2025

@typemytype should this get merged?

@typesupply
Copy link
Member Author

No. My solution doesn't work very well. It needs more thought. Thanks for checking though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants