[Webkit-unassigned] [Bug 98009] [GTK] WebKitDownload: use more of GOwnPtr/GRefPtr

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 1 03:49:24 PDT 2012


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #166441|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com>  2012-10-01 03:49:49 PST ---
(From update of attachment 166441)
View in context: https://bugs.webkit.org/attachment.cgi?id=166441&action=review

Thanks, GRefPtr increases the ref counter in the assign operator, so you need to adopt the ref to avoid it.

> Source/WebKit/gtk/webkit/webkitdownload.cpp:463
> +    GRefPtr<GFile> file = g_file_new_for_uri(uri);

You need to adopt the ref, use 

GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(uri));

> Source/WebKit/gtk/webkit/webkitdownload.cpp:698
> +        GRefPtr<GFile> src = g_file_new_for_uri(priv->destinationURI);
> +        GRefPtr<GFile> dest = g_file_new_for_uri(destination_uri);

These should be adopted too.

> Source/WebKit/gtk/webkit/webkitdownload.cpp:701
> +        g_file_move(src.get(), dest.get(), G_FILE_COPY_BACKUP, NULL, NULL, NULL, &error.outPtr());

Use 0 instead of NULL now that you are changing this line.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list