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



commit 3e618320d35bbdc17eb531a9bbb494b53d8abc21
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.

 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 7cb8e7c..90af628 100644
--- a/app/core/gimpgradient-load.c
+++ b/app/core/gimpgradient-load.c
@@ -423,8 +423,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]