[Webkit-unassigned] [Bug 142225] [GTK] WebView should hold a reference on WebContext because non-default contexts are a reality

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 3 23:13:40 PST 2015


Carlos Garcia Campos <cgarcia at igalia.com> changed:

           What    |Removed                     |Added
 Attachment #247772|review?                     |review-
              Flags|                            |

--- Comment #7 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 247772
  --> https://bugs.webkit.org/attachment.cgi?id=247772

View in context: https://bugs.webkit.org/attachment.cgi?id=247772&action=review

r- only because of the unit tests leaking.

> Source/WebKit2/ChangeLog:3
> +        WebView should hold a reference on WebContext because non-default contexts are a reality

Please use the bug title here, prepare-ChangeLog should do that automatically.

>> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:70
>> +    GRefPtr<WebKitWebView> webView = WEBKIT_WEB_VIEW(webkit_web_view_new_with_context(webContext.get()));
> I think you might be leaking webContext here, because you didn't use adoptGRef.

Yes, I think in this particular case that we are going to explicitly unref the object, the test is more obvious if it doesn't use "smart" pointers. Even more in the case of the WebView that is a widget and it's normally deleted with gtk_widget_destroy(). We should also use assertObjectIsDeletedWhenTestFinishes() with both the context and the web view to make sure we don't leak any of those.

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:77
> +    webContext = webkit_web_context_new();
> +    webView = WEBKIT_WEB_VIEW(webkit_web_view_new_with_context(webContext.get()));
> +    webView = nullptr;
> +    webContext = nullptr;

What's the point of doing it twice?

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/20150304/23eee22b/attachment-0002.html>

More information about the webkit-unassigned mailing list