[gnome-builder] ctags: add cancellation checks



commit 0d83423c0c4c486d0e08032eba4959f420ec9080
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jan 11 11:35:57 2019 -0800

    ctags: add cancellation checks

 src/plugins/ctags/ide-ctags-builder.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/ctags/ide-ctags-builder.c b/src/plugins/ctags/ide-ctags-builder.c
index 63ae07f58..14e8a104b 100644
--- a/src/plugins/ctags/ide-ctags-builder.c
+++ b/src/plugins/ctags/ide-ctags-builder.c
@@ -115,6 +115,9 @@ ide_ctags_builder_build (IdeCtagsBuilder *self,
   g_assert (G_IS_FILE (directory));
   g_assert (G_IS_FILE (destination));
 
+  if (g_cancellable_is_cancelled (cancellable))
+    return FALSE;
+
   context = ide_object_get_context (IDE_OBJECT (self));
   vcs = ide_object_get_child_typed (IDE_OBJECT (context), IDE_TYPE_VCS);
 
@@ -198,7 +201,7 @@ ide_ctags_builder_build (IdeCtagsBuilder *self,
   if (enumerator == NULL)
     IDE_GOTO (finish_subprocess);
 
-  while (NULL != (infoptr = g_file_enumerator_next_file (enumerator, cancellable, &error)))
+  while ((infoptr = g_file_enumerator_next_file (enumerator, cancellable, &error)))
     {
       g_autoptr(GFileInfo) info = infoptr;
       const gchar *name;


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