Skip to content

BUG: fix ownership, delay Py_SET_TYPE until the end - #53

Merged
seberg merged 1 commit into
seberg:heap-dtypesfrom
ngoldbaum:heap-dtypes
Jun 18, 2026
Merged

seberg merged 1 commit into
seberg:heap-dtypesfrom
ngoldbaum:heap-dtypes

Conversation

@ngoldbaum

Copy link
Copy Markdown

Fixes the ownership issues I was describing, along with a castingimpl leak.

Delaying Py_SET_TYPE until the very end avoids needing to roll back the change in the error paths, which technically needs to happen. I also added a comment to explain the ownership semantics.

@seberg

seberg commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Thanks, sorry, I rushed through the fixes yesterday and I think I missed that (I may have thought that "stealing" the singleton is fine due to interned, but that is silly).

@seberg
seberg merged commit a712e84 into seberg:heap-dtypes Jun 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants