Skip to content

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

@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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy