8000 Finalizer tries to dispose objects, that belong to previous Runtime "generation" · Issue #1073 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content
8000
Finalizer tries to dispose objects, that belong to previous Runtime "generation" #1073
Closed
@lostmsu

Description

@lostmsu

Environment

  • Pythonnet version: master
  • Python version: any
  • Operating System: any

Details

  1. Initialize Runtime
  2. Create a few PyObjects, keep them somewhere
  3. Shutdown Runtime
  4. Initialize Runtime the second time
  5. Clear all alive reference to objects from step 2.
  6. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0