Open ronaldoussoren opened 2 years ago
For (2) this only fails when also implementing the retain method, this ends up with nested GILState_Ensure states (which should work just fine...).
This happens with both 3.9 and 3.10.
Next up: try to reproduce in a C extension that does something similar without all of the PyObjC machinery, hopefully that helps pinpointing the issue.
As expected a simple extension that uses nested code with and without holding the GIL works just fine. This is almost certainly a bug in PyObjC, and one that requires more thought to fully understand.
test_nsobject.py found a number of related problems:
The implementation of retain, release and dealloc cannot use objc.super, for some reason that doesn't find the methodsThis was a bug in the test.Overriding dealloc and raising in it hangs the interpreter (waiting for the GIL)
The test for overriding dealloc crashes when one of the tests reuses an existing object (see comment)
I haven't investigated either.
Note that this doesn't affect user code, overriding these methods in Python Is never necessary.