Summary: | [GTK] webkit_uri_scheme_request_finish_error introspection broken | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | talby | ||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | NEW --- | ||||||
Severity: | Normal | CC: | bugs-noreply, mcatanzaro | ||||
Priority: | P3 | Keywords: | Gtk | ||||
Version: | Other | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Attachments: |
|
Description
talby
2018-02-09 17:35:16 PST
It's actually supposed to be (transfer none). Thanks, I'm new to these subsystems. Just to clarify, "(transfer none)" would correspond to GI_TRANSFER_NOTHING, and my problem is really with perl-Glib-Object-Introspection handling of this argument? (In reply to talby from comment #2) > Thanks, I'm new to these subsystems. Just to clarify, "(transfer none)" > would correspond to GI_TRANSFER_NOTHING, Yeah, it just means that the calling code does not transfer ownership when it calls the function. The GError is not freed by WebKit: it has to be freed by the caller, after calling the function. If we were to add a (transfer full) annotation, that would tell the application code (perl-Glib-Object-Introspection) that it should not free the GError because WebKit is responsible for doing so, and that would result in a memory leak, so that would be wrong. > and my problem is really with > perl-Glib-Object-Introspection handling of this argument? Well maybe. Or, it might also be broken in all languages, which would indicate a WebKit bug. That seems a bit more likely here. GError is kinda special in that it's usually an optional out parameter allocated by the function being called. webkit_uri_scheme_request_finish_error() doesn't follow the usual pattern at all, and it does not have any annotation to indicate this, so I suspect it's WebKit's fault and we need to add some new annotation there. I'll find time to look at this sooner or later. For faster results, if you're willing to try rebuilding WebKit, you could try this change: -@error: a #GError that will be passed to the #WebKitWebView +@error: (transfer none): a #GError that will be passed to the #WebKitWebView which is my first guess at how to solve this. If that's not sufficient, we might need to try some rarely-used annotations to override the defaults, like: -@error: a #GError that will be passed to the #WebKitWebView +@error: (transfer none) (not nullable) (in): a #GError that will be passed to the #WebKitWebView None of us here at webkit.org have much experience with introspection, so I'm just guessing. I looked into this today, but I don't know enough gobject-introspection to help. I translated your example into python and it's working fine for me there. At this point, I would recommend asking the perl-gi developers for advice; they'll probably know whether it's their bug or if we have to change our annotations somehow. They have a Bugzilla here: https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-perl Thanks so much! I will investigate the perl side of things. |