robotools / vanilla

A Pythonic wrapper around Cocoa.
MIT License
78 stars 28 forks source link

Use respondsToSelector instead of hasattr in _breakCycles. #200

Open typesupply opened 11 months ago

typesupply commented 11 months ago

This addresses #145.

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

typesupply commented 11 months ago

@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 commented 11 months ago

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

approved +1