[gnome-builder] pipeline: check task cancellation early



commit 639dafaf33ca8cd0cabe1755e0b2e667deb68caf
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 16 14:16:52 2017 -0800

    pipeline: check task cancellation early
    
    If the task has been canceled, don't even try to advance the pipeline.

 libide/buildsystem/ide-build-pipeline.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libide/buildsystem/ide-build-pipeline.c b/libide/buildsystem/ide-build-pipeline.c
index fa4f947..d5f3052 100644
--- a/libide/buildsystem/ide-build-pipeline.c
+++ b/libide/buildsystem/ide-build-pipeline.c
@@ -1108,6 +1108,10 @@ ide_build_pipeline_tick_execute (IdeBuildPipeline *self,
   g_assert (td->phase != IDE_BUILD_PHASE_NONE);
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
+  /* Short circuit now if the task was cancelled */
+  if (g_task_return_error_if_cancelled (task))
+    IDE_EXIT;
+
   /* If we can skip walking the pipeline, go ahead and do so now. */
   if (!ide_build_pipeline_request_phase (self, td->phase))
     {


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