[gnome-online-miners/wip/rishi/insert-share: 6/24] miner: Create the GTask before trying to return a GError



commit 5a00a2f401e7f4a2ff5df637968443df361a48af
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Sep 2 15:40:03 2016 +0200

    miner: Create the GTask before trying to return a GError
    
    Otherwise, we will violate our own assertion in
    gom_miner_complete_error.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770889

 src/gom-miner.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/gom-miner.c b/src/gom-miner.c
index 73c2a04..5bdd7b2 100644
--- a/src/gom-miner.c
+++ b/src/gom-miner.c
@@ -725,6 +725,9 @@ gom_miner_refresh_db_async (GomMiner *self,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
 {
+  self->priv->task = g_task_new (self, cancellable, callback, user_data);
+  g_task_set_source_tag (self->priv->task, gom_miner_refresh_db_async);
+
   if (self->priv->client_error != NULL)
     {
       gom_miner_complete_error (self, self->priv->client_error);
@@ -737,9 +740,6 @@ gom_miner_refresh_db_async (GomMiner *self,
       return;
     }
 
-  self->priv->task = g_task_new (self, cancellable, callback, user_data);
-  g_task_set_source_tag (self->priv->task, gom_miner_refresh_db_async);
-
   self->priv->cancellable =
     (cancellable != NULL) ? g_object_ref (cancellable) : NULL;
 


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