[tracker/tracker-1.12] libtracker-miner: Use TrackerDecorator variable after checking cancellable



commit dd8cf46dafb45bc46cbc97ce52d9aed2aec53101
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 25 10:59:22 2017 +0200

    libtracker-miner: Use TrackerDecorator variable after checking cancellable
    
    It may be actually destroyed if the decorator was cancelled.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785701

 src/libtracker-miner/tracker-decorator.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-decorator.c b/src/libtracker-miner/tracker-decorator.c
index aa1a7f0..c4c3b3c 100644
--- a/src/libtracker-miner/tracker-decorator.c
+++ b/src/libtracker-miner/tracker-decorator.c
@@ -792,8 +792,6 @@ decorator_query_remaining_items_cb (GObject      *object,
 
        cursor = tracker_sparql_connection_query_finish (TRACKER_SPARQL_CONNECTION (object),
                                                         result, &error);
-       priv = decorator->priv;
-        priv->querying = FALSE;
 
        if (error || !tracker_sparql_cursor_next (cursor, NULL, &error)) {
                decorator_notify_task_error (decorator, error);
@@ -801,6 +799,9 @@ decorator_query_remaining_items_cb (GObject      *object,
                return;
        }
 
+       priv = decorator->priv;
+       priv->querying = FALSE;
+
        priv->n_remaining_items = g_queue_get_length (&priv->item_cache) +
                tracker_sparql_cursor_get_integer (cursor, 0);
        g_object_unref (cursor);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]