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:

committed by
Sven Neumann

parent
cc8df78cb6
commit
b580628e4f
@ -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>
|
2004-07-27 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/actions/image-commands.c: include "libgimpbase/gimpbase.h",
|
* app/actions/image-commands.c: include "libgimpbase/gimpbase.h",
|
||||||
|
2
NEWS
2
NEWS
@ -34,6 +34,8 @@ Overview of Changes in GIMP 2.1.3
|
|||||||
|
|
||||||
- Renamed GimpColor boxed type to GimpRGB and moved it to libgimpcolor.
|
- 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 BMP loader plug-in (bug #143682).
|
||||||
|
|
||||||
- Fixes to the Decompose plug-in (bug #147603).
|
- Fixes to the Decompose plug-in (bug #147603).
|
||||||
|
@ -334,7 +334,6 @@ svg_parser_end_element (GMarkupParseContext *context,
|
|||||||
SvgParser *parser = user_data;
|
SvgParser *parser = user_data;
|
||||||
|
|
||||||
if (parser->gradient &&
|
if (parser->gradient &&
|
||||||
parser->stops &&
|
|
||||||
strcmp (element_name, "linearGradient") == 0)
|
strcmp (element_name, "linearGradient") == 0)
|
||||||
{
|
{
|
||||||
parser->gradient->segments = svg_parser_gradient_segments (parser->stops);
|
parser->gradient->segments = svg_parser_gradient_segments (parser->stops);
|
||||||
@ -352,10 +351,17 @@ svg_parser_end_element (GMarkupParseContext *context,
|
|||||||
static GimpGradientSegment *
|
static GimpGradientSegment *
|
||||||
svg_parser_gradient_segments (GList *stops)
|
svg_parser_gradient_segments (GList *stops)
|
||||||
{
|
{
|
||||||
GimpGradientSegment *segment = gimp_gradient_segment_new ();
|
GimpGradientSegment *segment;
|
||||||
SvgStop *stop = stops->data;
|
SvgStop *stop;
|
||||||
GList *list;
|
GList *list;
|
||||||
|
|
||||||
|
if (! stops)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
stop = stops->data;
|
||||||
|
|
||||||
|
segment = gimp_gradient_segment_new ();
|
||||||
|
|
||||||
segment->left_color = stop->color;
|
segment->left_color = stop->color;
|
||||||
segment->right_color = stop->color;
|
segment->right_color = stop->color;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user