Bug 150082 - [GTK] Use GUniquePtr for GtkIconInfo
Summary: [GTK] Use GUniquePtr for GtkIconInfo
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: ChangSeok Oh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-13 00:17 PDT by ChangSeok Oh
Modified: 2015-10-13 04:31 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.06 KB, patch)
2015-10-13 00:21 PDT, ChangSeok Oh
no flags Details | Formatted Diff | Diff
Patch (2.30 KB, patch)
2015-10-13 03:34 PDT, ChangSeok Oh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ChangSeok Oh 2015-10-13 00:17:09 PDT
SSIA
Comment 1 ChangSeok Oh 2015-10-13 00:21:54 PDT
Created attachment 262977 [details]
Patch
Comment 2 Carlos Garcia Campos 2015-10-13 01:21:11 PDT
Comment on attachment 262977 [details]
Patch

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

Thanks for the patch. This is not enough, though. With this patch the GtkIconInfo will be freed with g_free, not with gtk_icon_info_free(), You need to also include GUniquePtrGtk.h.

> Source/WebCore/rendering/RenderThemeGtk.cpp:242
>      GdkPixbuf* icon = 0;

Please change this to nullptr.

> Source/WebCore/rendering/RenderThemeGtk.cpp:244
> +        icon = gtk_icon_info_load_symbolic_for_context(info.get(), context, 0, 0);

nullptr, nullptr
Comment 3 ChangSeok Oh 2015-10-13 02:48:51 PDT
(In reply to comment #2)
> With this patch the GtkIconInfo will be freed with g_free, not with gtk_icon_info_free(), You need to also include GUniquePtrGtk.h.
Thanks for your review. =) I am not sure of this comment. We already have the gtk_icon_info_free in GUniquePtrGtk.h So the smart pointer has been used in ImageGtk.cpp
Comment 4 Carlos Garcia Campos 2015-10-13 02:52:59 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > With this patch the GtkIconInfo will be freed with g_free, not with gtk_icon_info_free(), You need to also include GUniquePtrGtk.h.
> Thanks for your review. =) I am not sure of this comment. We already have
> the gtk_icon_info_free in GUniquePtrGtk.h So the smart pointer has been used
> in ImageGtk.cpp

ImageGtk.cpp includes GUniquePtrGtk.h, but RenderThemeGtk.cpp doesn't.
Comment 5 ChangSeok Oh 2015-10-13 03:34:05 PDT
Created attachment 262981 [details]
Patch
Comment 6 ChangSeok Oh 2015-10-13 03:37:01 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > With this patch the GtkIconInfo will be freed with g_free, not with gtk_icon_info_free(), You need to also include GUniquePtrGtk.h.
> > Thanks for your review. =) I am not sure of this comment. We already have
> > the gtk_icon_info_free in GUniquePtrGtk.h So the smart pointer has been used
> > in ImageGtk.cpp
> 
> ImageGtk.cpp includes GUniquePtrGtk.h, but RenderThemeGtk.cpp doesn't.

Oh yeah. You are right.
Comment 7 WebKit Commit Bot 2015-10-13 04:31:23 PDT
Comment on attachment 262981 [details]
Patch

Clearing flags on attachment: 262981

Committed r190970: <http://trac.webkit.org/changeset/190970>
Comment 8 WebKit Commit Bot 2015-10-13 04:31:26 PDT
All reviewed patches have been landed.  Closing bug.