[epiphany/gnome-3-28] gsb-service: ref self for lifetime of update thread



commit 2a2dddcb8f4ef7386a0d06ebd56bca5ddb2f8960
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Thu Apr 18 20:05:21 2019 +0000

    gsb-service: ref self for lifetime of update thread
    
    Fixes #736
    
    
    (cherry picked from commit cefc3e33cca914cdc3130e589bc855491baaf004)
    
    (cherry picked from commit 28eee99ade1cfb4fa84b50f844e0bfac3c2a4b21)
    
    (cherry picked from commit 97bc80c65f4e13be1be1446668636f0f31cbc513)

 lib/safe-browsing/ephy-gsb-service.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/lib/safe-browsing/ephy-gsb-service.c b/lib/safe-browsing/ephy-gsb-service.c
index a99a6d243..e0b7fb331 100644
--- a/lib/safe-browsing/ephy-gsb-service.c
+++ b/lib/safe-browsing/ephy-gsb-service.c
@@ -292,6 +292,8 @@ out:
   g_list_free_full (threat_lists, (GDestroyNotify)ephy_gsb_threat_list_free);
 
   ephy_gsb_storage_set_metadata (self->storage, "next_list_updates_time", self->next_list_updates_time);
+
+  g_object_unref (self);
 }
 
 static void
@@ -313,7 +315,7 @@ ephy_gsb_service_update (EphyGSBService *self)
   g_assert (ephy_gsb_storage_is_operable (self->storage));
 
   g_atomic_int_set (&self->is_updating, TRUE);
-  task = g_task_new (self, NULL,
+  task = g_task_new (g_object_ref (self), NULL,
                      (GAsyncReadyCallback)ephy_gsb_service_update_finished_cb,
                      NULL);
   g_task_run_in_thread (task, (GTaskThreadFunc)ephy_gsb_service_update_thread);


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