-
Notifications
You must be signed in to change notification settings - Fork 104
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
Python_cffi we can't use automatic destructors? #1172
Comments
Either we remove garbage collection and only do manual cleanups or we add a method to remove cffi's gc() if we are passed to a method with "by_reference=1" @sappo any thoughts on this? |
Uff...this is tricky. So here's one thought. I do build separate wrapper c-library which wraps the destroy calls so the signature is compatible to what ffi.gc expects as destructor. We could add some logic to these wrapper functions so that the actual destroy function is only called if we have something to destroy. You can find the wrapper library in the |
But removing the gc function entirely would be the cleaner approach: |
IMO, the This might break some bindings though or at least remove the send function from those. Still I believe that's the correct solution here! |
Ow, indeed that would be nicest. But it would also mean this issue needs to move czmq |
Yes, this issue is also valid e.g. for the JNI binding. |
Take Zmsg for example. If we construct a message and want to send it. The sender becomes the owner and will destroy the message. However if we use garbage collection it will also try to destroy the message resulting in an assert.
I think the only solution is, is to stop using GC and do manual destruction.
Parking this here so I can work on this later.
The text was updated successfully, but these errors were encountered: