[gimp] app: fix progress handling in gimp_apply_operation()



commit 0f0da94f55dd93c43cec34c2828d572108aedd25
Author: Michael Natterer <mitch gimp org>
Date:   Fri Oct 12 20:09:47 2012 +0200

    app: fix progress handling in gimp_apply_operation()
    
    Only end the progress if we also started it here.

 app/core/gimp-apply-operation.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimp-apply-operation.c b/app/core/gimp-apply-operation.c
index 03b54cf..0a6f496 100644
--- a/app/core/gimp-apply-operation.c
+++ b/app/core/gimp-apply-operation.c
@@ -45,6 +45,7 @@ gimp_apply_operation (GeglBuffer          *src_buffer,
   GeglProcessor *processor;
   GeglRectangle  rect = { 0, };
   gdouble        value;
+  gboolean       progress_active = FALSE;
 
   g_return_if_fail (GEGL_IS_BUFFER (src_buffer));
   g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
@@ -80,7 +81,9 @@ gimp_apply_operation (GeglBuffer          *src_buffer,
 
   if (progress)
     {
-      if (gimp_progress_is_active (progress))
+      progress_active = gimp_progress_is_active (progress);
+
+      if (progress_active)
         {
           if (undo_desc)
             gimp_progress_set_text (progress, undo_desc);
@@ -99,6 +102,6 @@ gimp_apply_operation (GeglBuffer          *src_buffer,
 
   g_object_unref (gegl);
 
-  if (progress)
+  if (progress && ! progress_active)
     gimp_progress_end (progress);
 }



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