Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Finalizer tries to dispose objects, that belong to previous Runtime "generation" #1073

Copy link
Copy link
@lostmsu

Description

@lostmsu
Issue body actions

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.