[gimp/gimp-2-8] Bug 724295 - multiple svg gradients in a single file not listed correctly



commit c649efc2b8a528e52e0c139a43848a5fc73625ca
Author: Michael Natterer <mitch gimp org>
Date:   Thu Feb 13 22:06:12 2014 +0100

    Bug 724295 - multiple svg gradients in a single file not listed correctly
    
    Clear the parsed lis of stops after each gradient, or they will all
    look the same.
    
    (cherry picked from commit 3e618320d35bbdc17eb531a9bbb494b53d8abc21)

 app/core/gimpgradient-load.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpgradient-load.c b/app/core/gimpgradient-load.c
index 6f18bad..8116611 100644
--- a/app/core/gimpgradient-load.c
+++ b/app/core/gimpgradient-load.c
@@ -422,8 +422,16 @@ svg_parser_end_element (GMarkupParseContext  *context,
   if (parser->gradient &&
       strcmp (element_name, "linearGradient") == 0)
     {
+      GList *list;
+
       parser->gradient->segments = svg_parser_gradient_segments (parser->stops);
 
+      for (list = parser->stops; list; list = list->next)
+        g_slice_free (SvgStop, list->data);
+
+      g_list_free (parser->stops);
+      parser->stops = NULL;
+
       if (parser->gradient->segments)
         parser->gradients = g_list_prepend (parser->gradients,
                                             parser->gradient);


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