After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700725 - GIcon: NULLify the `type' out param in the sync methods too
GIcon: NULLify the `type' out param in the sync methods too
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-05-20 15:03 UTC by Emanuele Aina
Modified: 2013-05-28 21:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gicon: NULLify the `type' out param in the sync methods too (1.29 KB, patch)
2013-05-20 15:04 UTC, Emanuele Aina
needs-work Details | Review
GIcon: NULLify the `type' out param in the sync methods too (1.27 KB, patch)
2013-05-28 20:42 UTC, Emanuele Aina
committed Details | Review
GIcon: NULLify the `type' out param in the sync methods too (1.27 KB, patch)
2013-05-28 21:00 UTC, Emanuele Aina
committed Details | Review

Description Emanuele Aina 2013-05-20 15:03:59 UTC
Both g_[file|bytes]_icon_load() leave the `type' out parameter
untouched, while the async methods g_[file|bytes]_icon_load_finish()
always set it to NULL.

For consistency's sake we should probably NULLify it in the sync methods too.
Comment 1 Emanuele Aina 2013-05-20 15:04:01 UTC
Created attachment 244823 [details] [review]
gicon: NULLify the `type' out param in the sync methods too

Both g_[file|bytes]_icon_load() leave the `type' out parameter
untouched, while the async methods g_[file|bytes]_icon_load_finish()
always set it to NULL.

For consistency's sake NULLify it in the sync methods too.
Comment 2 Allison Karlitskaya (desrt) 2013-05-22 13:24:53 UTC
Review of attachment 244823 [details] [review]:

I'm not sure anybody is ever using this (or why it was added in the first place) but this patch is obviously an improvement over the current situation.

One nit: in the GFileIcon case, the loading could fail, and a GError be returned.  Conventionally, we don't set any out parameters in this case.  I would prefer if you reworked this part to only set the out parameter in the successful case.
Comment 3 Emanuele Aina 2013-05-28 20:42:22 UTC
Created attachment 245492 [details] [review]
GIcon: NULLify the `type' out param in the sync methods too

Do not nullify `type' if getting the GFileIcon stream failed.
Comment 4 Allison Karlitskaya (desrt) 2013-05-28 20:45:48 UTC
Review of attachment 245492 [details] [review]:

Thanks for the update.
Comment 5 Emanuele Aina 2013-05-28 21:00:14 UTC
The following fix has been pushed:
3382ac9 GIcon: NULLify the `type' out param in the sync methods too

Thanks!
Comment 6 Emanuele Aina 2013-05-28 21:00:54 UTC
Created attachment 245494 [details] [review]
GIcon: NULLify the `type' out param in the sync methods too

Both g_[file|bytes]_icon_load() leave the `type' out parameter
untouched, while the async methods g_[file|bytes]_icon_load_finish()
always set it to NULL.

For consistency's sake NULLify it in the sync methods too.