-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issues with Proc & GObject::Callback #61
Comments
Does JSCore have GIR information? GIR information for non-gobject based libraries are usually not good, maybe would be easier to try to use GJS instead? |
It does have gir information (it's part of webkit2gtk / gobject based afaik), here's a copy of it https://gist.github.com/GeopJr/aae89878ad6b83f3c6233191a109e0eb The shard works fine as per its readme, just some methods generated by gi-crystal dont. The |
I didn't check this issue in detail yet, but maybe cccab76 can help with it, it fixes callback signature generation. |
Unfortunately both issues still exist from what I've gathered |
When passing a Proc to C libraries we usually need to put the Proc inside a Box, then store this Box object in the With the current implementation of signals we have a similar problem... if you connect an object to some signal and never disconnect this signal the object will never be collected by GC because there will always be a reference to it in the |
Hi, I'm having some issues with JavaScriptCore bindings (https://github.com/GeopJr/JavaScriptCore.cr):
For example,
JavaScriptCore::ClassVTable#get_property=
acceptsJavaScriptCore::ClassGetPropertyFunction
(which is an alias forProc(JavaScriptCore::Class, JavaScriptCore::Context, Pointer(Void)?, JavaScriptCore::Value)
) generates:but
Proc#to_unsafe
is not a method.Almost all callbacks are of type
GObject::Callback
which I'm unsure how to work with - even after some manual editing, I couldn't get pastError: argument 'getter' of 'LibJavaScriptCore#jsc_class_add_property' must be Pointer(Void)
or invalid memory access.Example code for the first issue:
I understand if this is out of the scope of gi-crystal and I'll probably end up writing bindings manually if closed (as the api is not that big) 😅
Also surprised
getter
andsetter
work as method parametersThe text was updated successfully, but these errors were encountered: