mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
gio: handle GSimpleAsyncResult errors in _finish vmethods
Originally, the standard idiom with GSimpleAsyncResult was to handle all errors in the _finish wrapper function, so that vmethods only had to deal with successful results. But this means that chaining up to a parent _finish vmethod won't work correctly. Fix this by also checking for errors in all the relevant vmethods. (We have to redundantly check in both the vmethod and the wrapper to preserve compatibility.) https://bugzilla.gnome.org/show_bug.cgi?id=667375 https://bugzilla.gnome.org/show_bug.cgi?id=661767
This commit is contained in:
@@ -693,6 +693,9 @@ g_file_enumerator_real_next_files_finish (GFileEnumerator *enumer
|
||||
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
|
||||
g_file_enumerator_real_next_files_async);
|
||||
|
||||
if (g_simple_async_result_propagate_error (simple, error))
|
||||
return NULL;
|
||||
|
||||
op = g_simple_async_result_get_op_res_gpointer (simple);
|
||||
|
||||
res = op->files;
|
||||
@@ -750,7 +753,12 @@ g_file_enumerator_real_close_finish (GFileEnumerator *enumerator,
|
||||
GError **error)
|
||||
{
|
||||
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
|
||||
|
||||
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
|
||||
g_file_enumerator_real_close_async);
|
||||
|
||||
if (g_simple_async_result_propagate_error (simple, error))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user