Skip to content

Conversation

@neonene
Copy link
Contributor

@neoneneneonene commented Apr 22, 2024

Fix intentional memory leak during a finish by introducing _PyType_GetBaseBySpec() with a type slot ID.

Discussion: encukou/abi3#19

>python_d -X showrefcount -c "import ctypes" [188 refs, 132 blocks] # before [0 refs, 0 blocks] # after 

cc @encukou

@encukou
Copy link
Member

All metaclasses defined by _ctypes derive from PyCType_Type. So, if there are mro entries with the right ModuleDef, the last one is PyCType_Type.

@neonene

This comment was marked as outdated.

@encukou
Copy link
Member

Thank you for working on this. It clearly shows we need better APIs to handle type/module teardown correctly in general.
For a stdlib module, in 3.13, we can use implementation details for a less invasive fix: #119424.

@encukouencukou closed this May 22, 2024
@neoneneneonene deleted the basespec branch May 22, 2024 23:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@neonene@encukou