[gnome-builder] context: cleanup task usage



commit 9f1430bee52284dd13742de88dd7811d3735c50c
Author: Christian Hergert <chergert redhat com>
Date:   Mon Mar 6 18:06:18 2017 -0800

    context: cleanup task usage
    
    Just some cleanup to use g_steal_pointer() when appropriate and ensure
    we set source tags on the GTasks for debugging.

 libide/ide-context.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libide/ide-context.c b/libide/ide-context.c
index 3b89c90..fd08622 100644
--- a/libide/ide-context.c
+++ b/libide/ide-context.c
@@ -1684,11 +1684,12 @@ ide_context_unload_configuration_manager (gpointer             source_object,
   g_assert (IDE_IS_CONFIGURATION_MANAGER (self->configuration_manager));
 
   task = g_task_new (self, cancellable, callback, user_data);
+  g_task_set_source_tag (task, ide_context_unload_configuration_manager);
 
   ide_configuration_manager_save_async (self->configuration_manager,
                                         cancellable,
                                         ide_context_unload__configuration_manager_save_cb,
-                                        g_object_ref (task));
+                                        g_steal_pointer (&task));
 
   IDE_EXIT;
 }
@@ -1732,13 +1733,14 @@ ide_context_unload_back_forward_list (gpointer             source_object,
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
   task = g_task_new (self, cancellable, callback, user_data);
+  g_task_set_source_tag (task, ide_context_unload_back_forward_list);
 
   file = get_back_forward_list_file (self);
   _ide_back_forward_list_save_async (self->back_forward_list,
                                      file,
                                      cancellable,
                                      ide_context_unload__back_forward_list_save_cb,
-                                     g_object_ref (task));
+                                     g_steal_pointer (&task));
 
   IDE_EXIT;
 }


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