don't leak empty SVG gradients.

2004-07-27  Sven Neumann  <sven@gimp.org>

	* app/core/gimpgradient-load.c: don't leak empty SVG gradients.
This commit is contained in:
Sven Neumann 2004-07-27 19:34:27 +00:00 committed by Sven Neumann
parent cc8df78cb6
commit b580628e4f
3 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2004-07-27 Sven Neumann <sven@gimp.org>
* app/core/gimpgradient-load.c: don't leak empty SVG gradients.
2004-07-27 Sven Neumann <sven@gimp.org>
* app/actions/image-commands.c: include "libgimpbase/gimpbase.h",

2
NEWS
View File

@ -34,6 +34,8 @@ Overview of Changes in GIMP 2.1.3
- Renamed GimpColor boxed type to GimpRGB and moved it to libgimpcolor.
- Moved GIMP_TYPE_UNIT and GIMP_TYPE_MEMSIZE to libgimpbase.
- Fixes to the BMP loader plug-in (bug #143682).
- Fixes to the Decompose plug-in (bug #147603).

View File

@ -334,7 +334,6 @@ svg_parser_end_element (GMarkupParseContext *context,
SvgParser *parser = user_data;
if (parser->gradient &&
parser->stops &&
strcmp (element_name, "linearGradient") == 0)
{
parser->gradient->segments = svg_parser_gradient_segments (parser->stops);
@ -352,10 +351,17 @@ svg_parser_end_element (GMarkupParseContext *context,
static GimpGradientSegment *
svg_parser_gradient_segments (GList *stops)
{
GimpGradientSegment *segment = gimp_gradient_segment_new ();
SvgStop *stop = stops->data;
GimpGradientSegment *segment;
SvgStop *stop;
GList *list;
if (! stops)
return NULL;
stop = stops->data;
segment = gimp_gradient_segment_new ();
segment->left_color = stop->color;
segment->right_color = stop->color;