GNOME Bugzilla – Bug 636673
g_simple_async_report_error_in_idle should allow object to be NULL
Last modified: 2010-12-20 16:21:40 UTC
There appears to be a slight inconsistency between how g_simple_async_result_new and g_simple_async_report_error_in_idle work. The former allows the first parameter, a GObject, to be NULL, while the latter does not. Additionally, g_simple_async_report_take_gerror_in_idle contains the same bug. Change is as simple as modifying: g_return_if_fail (G_IS_OBJECT (object)); to g_return_val_if_fail (!object || G_IS_OBJECT (object), NULL); for both g_simple_async_report_take_gerror_in_idle and g_simple_async_report_error_in_idle
I should also note that the documentation should also be updated to note that GObject is allowed to be NULL for these functions, as it does for g_simple_async_result_new Also, g_simple_async_report_gerror_in_idle contains the issue too
Created attachment 176180 [details] [review] Document and allow passing of NULL for the object consistently
Review of attachment 176180 [details] [review]: Thanks, please commit
Pushed.
Looks like g_simple_async_report_gerror_in_idle still has the issue: http://git.gnome.org/browse/glib/tree/gio/gsimpleasyncresult.c?id=ddc126cf2cbbdbc3a98e7bd397f19fb0ac8c27c4#n1023
Thanks for pointing out the missing piece, fixed now.