[libdazzle] search: use g_steal_pointer() with errors
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] search: use g_steal_pointer() with errors
- Date: Wed, 6 Dec 2017 10:35:02 +0000 (UTC)
commit 100d925875f445d23873ba690d6217850c14a99e
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 6 02:33:52 2017 -0800
search: use g_steal_pointer() with errors
src/search/dzl-fuzzy-index-builder.c | 4 ++--
src/search/dzl-fuzzy-index.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/search/dzl-fuzzy-index-builder.c b/src/search/dzl-fuzzy-index-builder.c
index 6ade0a3..ddc17a0 100644
--- a/src/search/dzl-fuzzy-index-builder.c
+++ b/src/search/dzl-fuzzy-index-builder.c
@@ -452,9 +452,9 @@ dzl_fuzzy_index_builder_write_worker (GTask *task,
DzlFuzzyIndexBuilder *self = source_object;
g_autoptr(GVariant) variant = NULL;
g_autoptr(GVariant) documents = NULL;
+ g_autoptr(GError) error = NULL;
GVariantDict dict;
GFile *file = task_data;
- GError *error = NULL;
g_assert (G_IS_TASK (task));
g_assert (DZL_IS_FUZZY_INDEX_BUILDER (self));
@@ -518,7 +518,7 @@ dzl_fuzzy_index_builder_write_worker (GTask *task,
NULL,
cancellable,
&error))
- g_task_return_error (task, error);
+ g_task_return_error (task, g_steal_pointer (&error));
else
g_task_return_boolean (task, TRUE);
}
diff --git a/src/search/dzl-fuzzy-index.c b/src/search/dzl-fuzzy-index.c
index d8a2fe9..026cff2 100644
--- a/src/search/dzl-fuzzy-index.c
+++ b/src/search/dzl-fuzzy-index.c
@@ -145,10 +145,10 @@ dzl_fuzzy_index_load_file_worker (GTask *task,
g_autoptr(GVariant) keys = NULL;
g_autoptr(GVariant) tables = NULL;
g_autoptr(GVariant) metadata = NULL;
+ g_autoptr(GError) error = NULL;
DzlFuzzyIndex *self = source_object;
GFile *file = task_data;
GVariantDict dict;
- GError *error = NULL;
gint version = 0;
gboolean case_sensitive = FALSE;
@@ -178,7 +178,7 @@ dzl_fuzzy_index_load_file_worker (GTask *task,
if (NULL == (mapped_file = g_mapped_file_new (path, FALSE, &error)))
{
- g_task_return_error (task, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
@@ -305,14 +305,14 @@ dzl_fuzzy_index_query_cb (GObject *object,
{
DzlFuzzyIndexCursor *cursor = (DzlFuzzyIndexCursor *)object;
g_autoptr(GTask) task = user_data;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
g_assert (DZL_IS_FUZZY_INDEX_CURSOR (cursor));
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (G_IS_TASK (task));
if (!g_async_initable_init_finish (G_ASYNC_INITABLE (cursor), result, &error))
- g_task_return_error (task, error);
+ g_task_return_error (task, g_steal_pointer (&error));
else
g_task_return_pointer (task, g_object_ref (cursor), g_object_unref);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]