diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-10-06 21:35:14 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-10-06 21:37:01 +0800 |
commit | 126aa2398abc1bbab0fd0cd76fda5042cc83fe76 (patch) | |
tree | a56dac4e77d7fad6901468564caa09644a1a806b /modules/composer-autosave | |
parent | 938505da180727fbc56b68b80851adc3cf676523 (diff) | |
download | gsoc2013-evolution-126aa2398abc1bbab0fd0cd76fda5042cc83fe76.tar.gz gsoc2013-evolution-126aa2398abc1bbab0fd0cd76fda5042cc83fe76.tar.zst gsoc2013-evolution-126aa2398abc1bbab0fd0cd76fda5042cc83fe76.zip |
Prefer g_simple_async_result_take_error().
Slightly more efficient and convenient than:
g_simple_async_result_set_from_error (simple, error);
g_error_free (error);
One less GError to copy and destroy.
Diffstat (limited to 'modules/composer-autosave')
-rw-r--r-- | modules/composer-autosave/e-autosave-utils.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/modules/composer-autosave/e-autosave-utils.c b/modules/composer-autosave/e-autosave-utils.c index 9c5eaa8236..8d03aaaecc 100644 --- a/modules/composer-autosave/e-autosave-utils.c +++ b/modules/composer-autosave/e-autosave-utils.c @@ -137,9 +137,8 @@ load_snapshot_loaded_cb (GFile *snapshot_file, if (error != NULL) { g_warn_if_fail (contents == NULL); - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); - g_error_free (error); return; } @@ -154,10 +153,9 @@ load_snapshot_loaded_cb (GFile *snapshot_file, g_free (contents); if (error != NULL) { - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (message); - g_error_free (error); return; } @@ -192,10 +190,8 @@ save_snapshot_splice_cb (GOutputStream *output_stream, g_output_stream_splice_finish (output_stream, result, &error); - if (error != NULL) { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + if (error != NULL) + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); @@ -220,10 +216,9 @@ save_snapshot_get_message_cb (EMsgComposer *composer, if (error != NULL) { g_warn_if_fail (message == NULL); - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); - g_error_free (error); return; } @@ -281,10 +276,9 @@ save_snapshot_replace_cb (GFile *snapshot_file, if (error != NULL) { g_warn_if_fail (output_stream == NULL); - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); - g_error_free (error); return; } @@ -480,10 +474,9 @@ e_composer_save_snapshot (EMsgComposer *composer, if (error != NULL) { g_warn_if_fail (snapshot_file == NULL); - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); - g_error_free (error); return; } |