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 755351 - Example still contains g_autoptr(gchar)
Example still contains g_autoptr(gchar)
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-09-21 13:47 UTC by Xavier Claessens
Modified: 2015-09-22 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Doc: g_autoptr(gchar) has been replaced by g_autofree (993 bytes, patch)
2015-09-21 13:54 UTC, Xavier Claessens
none Details | Review
Doc: g_autoptr(gchar) has been replaced by g_autofree (997 bytes, patch)
2015-09-21 14:12 UTC, Xavier Claessens
committed Details | Review
Remove useless NULL check before g_free() (671 bytes, patch)
2015-09-21 14:51 UTC, Xavier Claessens
committed Details | Review

Description Xavier Claessens 2015-09-21 13:47:23 UTC
The doc of g_autoptr() still contains:
  g_autoptr(gchar) path = NULL;

But that has been removed in favor of g_autofree().
Comment 1 Xavier Claessens 2015-09-21 13:54:41 UTC
Created attachment 311755 [details] [review]
Doc: g_autoptr(gchar) has been replaced by g_autofree
Comment 2 Xavier Claessens 2015-09-21 13:55:58 UTC
While I was there, I see that g_autoptr_cleanup_generic_gfree() has a if(*pp)g_free(*pp). g_free() is already NULL-safe so that condition is useless and should be removed, right?
Comment 3 Xavier Claessens 2015-09-21 14:12:46 UTC
Created attachment 311760 [details] [review]
Doc: g_autoptr(gchar) has been replaced by g_autofree
Comment 4 Matthias Clasen 2015-09-21 14:42:30 UTC
Review of attachment 311760 [details] [review]:

Looks fine to me
Comment 5 Matthias Clasen 2015-09-21 14:43:56 UTC
(In reply to Xavier Claessens from comment #2)
> While I was there, I see that g_autoptr_cleanup_generic_gfree() has a
> if(*pp)g_free(*pp). g_free() is already NULL-safe so that condition is
> useless and should be removed, right?

Seems so
Comment 6 Xavier Claessens 2015-09-21 14:51:51 UTC
Created attachment 311764 [details] [review]
Remove useless NULL check before g_free()
Comment 7 Matthias Clasen 2015-09-22 03:30:13 UTC
Review of attachment 311764 [details] [review]:

sure
Comment 8 Xavier Claessens 2015-09-22 13:44:39 UTC
Thanks