Skip to content
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

Add a global set to hold references to the handles we create. Need to… #41

Merged
merged 1 commit into from
Jan 31, 2016

Conversation

drnlm
Copy link
Member

@drnlm drnlm commented Jan 30, 2016

… fix a bug exposed by later cffi versions

Fixes the current breakage on travis.

@hodgestar
Copy link
Member

Looks good to me. Just wanted to check whether, in the cases where we don't set rwops.hidden.unknown.data1 ourselves (i.e. we get rwops from SDL_RWFromFP), data1 is still guaranteed to be set to something sensible for discarding from __localhandles?

@drnlm
Copy link
Member Author

drnlm commented Jan 31, 2016

We only add the obj_close method (where discard is called) onto objects where we've explicitly set data1 - if we get rwops fro SDL_RWFromFP, then the SDL functions are used, no handle is created and this code isn't involved.

There is a potential concern that this approach can leak references - destroying a RWOps object without explicitly call close will leave a non longer useful handle still in the set - I don't see that this is particularly worth worrying about, since we already leak some memory because SDL_FreeRW isn't called in that case either (as does pygame).

@hodgestar
Copy link
Member

Woot.

👍

drnlm added a commit that referenced this pull request Jan 31, 2016
Add a global set to hold references to the handles we create. Need to…
@drnlm drnlm merged commit 73fd523 into master Jan 31, 2016
@drnlm drnlm deleted the bugs/fix_cffi_from_handle_breakage branch January 31, 2016 22:56
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