[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 106/116] tracker-miner: Fix cancellation of g_file_enumerator_next_files_async
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/shuffle-libtracker-miner: 106/116] tracker-miner: Fix cancellation of g_file_enumerator_next_files_async
- Date: Thu, 12 Dec 2019 10:25:01 +0000 (UTC)
commit ea0fd1d414b11f1c9813e6552a826526a6dcd37d
Author: Andrea Azzarone <andrea azzarone canonical com>
Date: Mon Apr 1 16:52:15 2019 +0100
tracker-miner: Fix cancellation of g_file_enumerator_next_files_async
The async op is not owner of the user data, so it may be actually gone in the
GAsyncReadyCallback. Ensure we only use it on success or on other errors than
cancelled.
Closes: https://gitlab.gnome.org/GNOME/tracker/issues/86
src/libtracker-miner/tracker-crawler.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-crawler.c b/src/libtracker-miner/tracker-crawler.c
index 10f270a4f..56c3a45e9 100644
--- a/src/libtracker-miner/tracker-crawler.c
+++ b/src/libtracker-miner/tracker-crawler.c
@@ -903,7 +903,7 @@ enumerate_next_cb (GObject *object,
{
DataProviderData *dpd;
GList *info;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
info = g_file_enumerator_next_files_finish (G_FILE_ENUMERATOR (object), result, &error);
dpd = user_data;
@@ -922,9 +922,9 @@ enumerate_next_cb (GObject *object,
g_warning ("Could not enumerate next item in container / directory '%s', %s",
uri, error ? error->message : "no error given");
g_free (uri);
+ } else {
+ return;
}
-
- g_clear_error (&error);
} else {
/* Done enumerating, start processing what we got ... */
data_provider_data_add (dpd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]