New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dealloc use tp_free or don't allow inheritance #355

Merged
merged 1 commit into from Mar 27, 2014

Conversation

Projects
None yet
2 participants
@carlosmn
Member

carlosmn commented Mar 27, 2014

When a class is a base type, it must use its type's tp_free function to
trigger the real free, instead of PyObjec_Del().

We do not always follow this convention, so let's give it a once-over
and make sure we do that or that it's not a base type. Many of the types
have the flag set in the struct, but do not pass the allocator function
at init time, which makes them not really be a base. Remove the flag for
those types.


I've only actually seen this be an issue with the credentials (in the version where they're in C). I'm not sure why that causes issues but the repository doesn't.

Make dealloc use tp_free or don't allow inheritance
When a class is a base type, it must use its type's tp_free function to
trigger the real free, instead of PyObjec_Del().

We do not always follow this convention, so let's give it a once-over
and make sure we do that or that it's not a base type. Many of the types
have the flag set in the struct, but do not pass the allocator function
at init time, which makes them not really be a base. Remove the flag for
those types.

@jdavid jdavid merged commit 940a6da into libgit2:master Mar 27, 2014

1 check passed

default The Travis CI build passed
Details

@carlosmn carlosmn deleted the carlosmn:tp-free branch Mar 27, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment