-
Notifications
You must be signed in to change notification settings - Fork 23
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
Alter the generator to free strings returned by GEOS. #122
Conversation
Too bad this didn't solve your issue. What are your thoughts about merging this? Do you know that this is always safe? Right now an exception is made for GEOSVersion since it is the only function from http://libgeos.org/doxygen/geos__c_8h.html that returns Here are some related links for GDAL.jl: |
Hi Martijn, I am as circumspect as you are about this PR TBH. I you are interested in this PR, I can try to improve it until it's good enough to be merged. Maybe you or some onlookers have suggestions to improve it. Nico. |
Hi @visr I think I'm ready for a round of review. |
Also adds the context argument, though it is not used yet.
This looks quite good, thanks for going through the extra effort to automatically detect when to free strings. That might be useful in other wrappers as well. I rebased the branch, and if you don't mind renamed to |
yes, I spent an inordinate amount of time looking into how to use clang, but I think it gives a good hint for other people who want to do things with types, I couldn't find any example anywhere. I'll takle the context pointer soon. |
@Gnimuc do you think https://github.com/JuliaGeo/LibGEOS.jl/blob/6fd06dbc7994bb4a221c4bac53f2c5a9a42e31b7/gen/generator.jl is worth linking to in https://github.com/JuliaInterop/Clang.jl#examples? The |
I am ready for a next round of review. I unwrapped the pointer for the context, because from the low level we only have access to the pointer, not the full object. |
Sorry for letting this slip @nraynaud. Thank you for your effort! |
I have a memory leak in my use of GEOS, and I studied freeing strings as an hypothesis, so here is the code.
Sadly, I couldn't find my leak.