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 721458 - g_simple_async_result_is_valid has a NULL check for the wrong source_tag
g_simple_async_result_is_valid has a NULL check for the wrong source_tag
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-01-04 14:50 UTC by Ross Lagerwall
Modified: 2014-02-16 14:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ross Lagerwall 2014-01-04 14:50:59 UTC
If g_simple_async_report_error_in_idle() is used, the source_tag of the result is NULL.
If you then pass in the _async function as the source_tag (as done in the example in the documentation) into g_simple_async_result_is_valid(), it returns FALSE because the following line fails:
  return source_tag == NULL ||
         source_tag == g_simple_async_result_get_source_tag (simple);

I think the NULL check should instead be done on g_simple_async_result_get_source_tag (simple) and the documentation should be updated.

This problem came up in gvfs:
https://bugzilla.gnome.org/show_bug.cgi?id=720743#c3

Thanks
Comment 1 Matthias Clasen 2014-02-07 00:20:22 UTC
I think that is right
Comment 2 Dan Winship 2014-02-16 14:28:08 UTC
I pushed a fix to allow either the result's source tag or the
passed-in source tag to be NULL; just switching the check from one to
the other seemed like it would probably break some existing code.