[Webkit-unassigned] [Bug 182666] [GTK] webkit_uri_scheme_request_finish_error introspection broken

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 13 16:25:04 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=182666

--- Comment #3 from Michael Catanzaro <mcatanzaro at igalia.com> ---
(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:

- at error: a #GError that will be passed to the #WebKitWebView
+ at 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:

- at error: a #GError that will be passed to the #WebKitWebView
+ at 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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180214/35d8c739/attachment.html>


More information about the webkit-unassigned mailing list