[gnome-builder] subprocess: always ensure outstanding_ops are > 0 until dispatch



commit 3cc9b93a0b629bb2cf278c531b991f693d48e2de
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 14 00:41:01 2016 -0700

    subprocess: always ensure outstanding_ops are > 0 until dispatch
    
    Be defensive here. It's not clear to me if we can fully guard against
    all of these from firing sooner.

 libide/subprocess/ide-breakout-subprocess.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libide/subprocess/ide-breakout-subprocess.c b/libide/subprocess/ide-breakout-subprocess.c
index fc03b6f..6432c4e 100644
--- a/libide/subprocess/ide-breakout-subprocess.c
+++ b/libide/subprocess/ide-breakout-subprocess.c
@@ -701,6 +701,7 @@ ide_breakout_subprocess_communicate_internal (IdeBreakoutSubprocess *subprocess,
 
   state->cancellable = g_cancellable_new ();
   state->add_nul = add_nul;
+  state->outstanding_ops = 1;
 
   if (cancellable)
     {
@@ -743,7 +744,6 @@ ide_breakout_subprocess_communicate_internal (IdeBreakoutSubprocess *subprocess,
 
   ide_subprocess_wait_async (IDE_SUBPROCESS (subprocess), state->cancellable,
                              ide_subprocess_communicate_made_progress, g_object_ref (task));
-  state->outstanding_ops++;
 
   IDE_RETURN (state);
 }


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