| Summary: | [GTK] Wrong free function in documentation for webkit_web_view_evaluate_javascript | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Rolf Gebhardt <buggy> |
| Component: | WebKitGTK | Assignee: | Michael Catanzaro <mcatanzaro> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | buggy, bugs-noreply, mcatanzaro |
| Priority: | P2 | Keywords: | Gtk |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | https://webkitgtk.org/reference/webkit2gtk/stable/method.WebView.evaluate_javascript.html | ||
|
Description
Rolf Gebhardt
2023-09-01 12:02:57 PDT
Good catch, thanks! (In reply to Rolf from comment #0) > Therefore, it remains unclear how to correctly deal with the JSCValue > "value" returned by the function webkit_web_view_evaluate_javascript_finish. It's a GObject, so use g_object_unref(). Pull request: https://github.com/WebKit/WebKit/pull/17354 (In reply to Michael Catanzaro from comment #1) > Good catch, thanks! > > (In reply to Rolf from comment #0) > > Therefore, it remains unclear how to correctly deal with the JSCValue > > "value" returned by the function webkit_web_view_evaluate_javascript_finish. > > It's a GObject, so use g_object_unref(). Thanks a lot for the hint and for fixing. I have another small point concerning the same function: The documentation to the first parameter "script" says: "The value is a NUL terminated UTF-8 string." The second parameter "length" tells us: "Length of script, or -1 if script is a nul-terminated string." I understand what is meant. But perhaps the description of "script" should reflect the two possibilities to specify the end of the string. (Not really important, just a suggestion) Let's fix that too. Actually that's not part of the docs itself, but from gi-docgen. We should have used unsigned char * for this API to indicate that it is a string of bytes that may or may not be nul-terminated, rather than char * which indicates a nul-terminated UTF-8 string. But we cannot fix the type until the next API version. Committed 267583@main (ddb67f54d767): <https://commits.webkit.org/267583@main> Reviewed commits have been landed. Closing PR #17354 and removing active labels. |