[gnome-builder] buildmanager: ensure regular builds can be cancelled



commit 2b69a057e9ef74dbae6be92961309a1caa769fbe
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 16 14:29:10 2017 -0800

    buildmanager: ensure regular builds can be cancelled
    
    If we used the action to start a build, we could not cancel it because a
    GCancellable was not used. This instead creates one if we were not given
    one to reuse, which fixes the problem.

 libide/buildsystem/ide-build-manager.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libide/buildsystem/ide-build-manager.c b/libide/buildsystem/ide-build-manager.c
index f50ba03..3b51f8e 100644
--- a/libide/buildsystem/ide-build-manager.c
+++ b/libide/buildsystem/ide-build-manager.c
@@ -975,6 +975,7 @@ ide_build_manager_execute_async (IdeBuildManager     *self,
                                  GAsyncReadyCallback  callback,
                                  gpointer             user_data)
 {
+  g_autoptr(GCancellable) local_cancellable = NULL;
   g_autoptr(GTask) task = NULL;
   IdeContext *context;
   IdeBufferManager *buffer_manager;
@@ -984,6 +985,9 @@ ide_build_manager_execute_async (IdeBuildManager     *self,
   g_return_if_fail (IDE_IS_BUILD_MANAGER (self));
   g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
 
+  if (cancellable == NULL)
+    cancellable = local_cancellable = g_cancellable_new ();
+
   task = g_task_new (self, cancellable, callback, user_data);
   g_task_set_source_tag (task, ide_build_manager_execute_async);
 


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