GSimpleAsyncResult: add error-taking variants

Add g_simple_async_result_new_take_error and
g_simple_async_result_take_error, which take over ownership of the
given error. Based on a patch by Christian Persch.

https://bugzilla.gnome.org/show_bug.cgi?id=629247
This commit is contained in:
Matthias Clasen
2010-10-31 22:38:38 -04:00
parent 7887103193
commit 85ba8596e2
3 changed files with 67 additions and 3 deletions

View File

@@ -60,6 +60,10 @@ GSimpleAsyncResult *g_simple_async_result_new_error (GObject
const char *format,
...) G_GNUC_PRINTF (6, 7);
GSimpleAsyncResult *g_simple_async_result_new_from_error (GObject *source_object,
GAsyncReadyCallback callback,
gpointer user_data,
const GError *error);
GSimpleAsyncResult *g_simple_async_result_new_take_error (GObject *source_object,
GAsyncReadyCallback callback,
gpointer user_data,
GError *error);
@@ -90,6 +94,8 @@ void g_simple_async_result_run_in_thread (GSimpleAsyncResult
GCancellable *cancellable);
void g_simple_async_result_set_from_error (GSimpleAsyncResult *simple,
const GError *error);
void g_simple_async_result_take_error (GSimpleAsyncResult *simple,
GError *error);
gboolean g_simple_async_result_propagate_error (GSimpleAsyncResult *simple,
GError **dest);
void g_simple_async_result_set_error (GSimpleAsyncResult *simple,