[gimp] plug-ins: fixing error popup when canceling webp export.



commit 294d92250cf1d5953bbc27f2c51ff6da2892ab66
Author: Jehan <jehan girinstud io>
Date:   Tue Nov 8 03:47:20 2016 +0100

    plug-ins: fixing error popup when canceling webp export.
    
    Even when the export dialog does not end as success, we must cleanly
    exit the plugin by setting the return values.

 plug-ins/file-webp/file-webp.c |   24 ++++++++++--------------
 1 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/plug-ins/file-webp/file-webp.c b/plug-ins/file-webp/file-webp.c
index 3daa0ed..8171f7c 100644
--- a/plug-ins/file-webp/file-webp.c
+++ b/plug-ins/file-webp/file-webp.c
@@ -257,21 +257,17 @@ run (const gchar      *name,
             }
         }
 
-      if (status != GIMP_PDB_SUCCESS)
-        {
-          g_free (params.preset);
-          g_free (layers);
-          return;
-        }
-
-      if (! save_image (param[3].data.d_string,
-                        n_layers, layers,
-                        image_ID,
-                        drawable_ID,
-                        &params,
-                        &error))
+      if (status == GIMP_PDB_SUCCESS)
         {
-          status = GIMP_PDB_EXECUTION_ERROR;
+          if (! save_image (param[3].data.d_string,
+                            n_layers, layers,
+                            image_ID,
+                            drawable_ID,
+                            &params,
+                            &error))
+            {
+              status = GIMP_PDB_EXECUTION_ERROR;
+            }
         }
 
       g_free (params.preset);


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