[gnome-builder/gnome-builder-3-20] autotools: pop old arguments before reusing launcher



commit 4b088ef93aefab6d084d386145a27efc45384145
Author: Christian Hergert <chergert redhat com>
Date:   Mon May 9 13:26:51 2016 +0300

    autotools: pop old arguments before reusing launcher
    
    We weren't really intending to reuse launchers, but it seems rather
    convenient to be able to reuse the launcher at times.

 plugins/autotools/ide-autotools-build-task.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/autotools/ide-autotools-build-task.c b/plugins/autotools/ide-autotools-build-task.c
index a603825..38a400a 100644
--- a/plugins/autotools/ide-autotools-build-task.c
+++ b/plugins/autotools/ide-autotools-build-task.c
@@ -627,6 +627,7 @@ log_and_spawn (IdeAutotoolsBuildTask  *self,
   GString *log;
   gchar *item;
   va_list args;
+  gint popcnt = 0;
 
   g_assert (IDE_IS_AUTOTOOLS_BUILD_TASK (self));
   g_assert (IDE_IS_SUBPROCESS_LAUNCHER (launcher));
@@ -640,6 +641,7 @@ log_and_spawn (IdeAutotoolsBuildTask  *self,
     {
       ide_subprocess_launcher_push_argv (launcher, item);
       g_string_append_printf (log, " '%s'", item);
+      popcnt++;
     }
   va_end (args);
 
@@ -650,6 +652,13 @@ log_and_spawn (IdeAutotoolsBuildTask  *self,
 
   ret = ide_subprocess_launcher_spawn_sync (launcher, cancellable, error);
 
+  /* pop make args */
+  for (; popcnt; popcnt--)
+    g_free (ide_subprocess_launcher_pop_argv (launcher));
+
+  /* pop "make" */
+  g_free (ide_subprocess_launcher_pop_argv (launcher));
+
   return ret;
 }
 


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