Skip to content

Correctly free DTrace resources.#26

Merged
tmetsch merged 1 commit into
tmetsch:masterfrom
Cambridge-AdvancedOS:kwitaszczyk-free-handle
Feb 15, 2022
Merged

Correctly free DTrace resources.#26
tmetsch merged 1 commit into
tmetsch:masterfrom
Cambridge-AdvancedOS:kwitaszczyk-free-handle

Conversation

@kwitaszczyk

Copy link
Copy Markdown
Contributor

Cython's cdef attributes are not regular class attributes as in Python.
hasattr(object, name) always returns False for a cdef attribute
corresponding to name.

Instead, we should simply check a pointer's value. I couldn't confirm
it in any documentation but, based on examples I found and my
experiments, it seems that a cdef pointer is always initially set to
NULL, at least when declared as a class attribute.

Cython's cdef attributes are not regular class attributes as in Python.
hasattr(object, name) always returns False for a cdef attribute
corresponding to name.

Instead, we should simply check a pointer's value. I couldn't confirm
it in any documentation but, based on examples I found and my
experiments, it seems that a cdef pointer is always initially set to
NULL, at least when declared as a class attribute.
@tmetsch

tmetsch commented Feb 10, 2022

Copy link
Copy Markdown
Owner

Thanks @kwitaszczyk let me check this stuff and I'll merge this & prep for a new release asap.

@tmetsch tmetsch merged commit 1d9960e into tmetsch:master Feb 15, 2022
@kwitaszczyk kwitaszczyk deleted the kwitaszczyk-free-handle branch February 15, 2022 13:48
@tmetsch

tmetsch commented Feb 15, 2022

Copy link
Copy Markdown
Owner

Now released as v0.0.14. Thanks again! Beer on me once we meet (y)

@kwitaszczyk

Copy link
Copy Markdown
Contributor Author

Thank you, @tmetsch, for a quick response! I'm up for the beer some day. :)

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