Environment
- Pythonnet version: master
- Python version: any
- Operating System: any
Details
- Initialize
Runtime
- Create a few
PyObjects, keep them somewhere
- Shutdown
Runtime
- Initialize
Runtime the second time
- Clear all alive reference to objects from step 2.
- Call
GC.Collect and WaitForPendingFinalizers
Expected: XDecref should never be called on the handles in PyObjects from step 2.
Actual: XDecref is called on the handles in PyObjects from step 2.
I saw this happen even to .NET types reflected to Python like System.MulticastDelegate. Will soon open a PR with repro.