possible memory leak in cairo?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
jstph
Posts: 31
Joined: 2011-01-27T10:07:43-07:00
Authentication code: 8675308

possible memory leak in cairo?

Post by jstph »

Magick,
I am no familiar with Cairo, my vld tool report there is memory leak in imagemagick-6.8.8\cairo\src\cairo-image-surface.c (181): _cairo_image_surface_create_for_pixman_image.
I checked that chunk source code.

Code: Select all

cairo_surface_t *
_cairo_image_surface_create_for_pixman_image (pixman_image_t		*pixman_image,
					      pixman_format_code_t	 pixman_format)
{
    cairo_image_surface_t *surface;

    surface = malloc (sizeof (cairo_image_surface_t));
    if (unlikely (surface == NULL))
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));

    _cairo_surface_init (&surface->base,
			 &_cairo_image_surface_backend,
			 NULL, /* device */
			 _cairo_content_from_pixman_format (pixman_format));

    _cairo_image_surface_init (surface, pixman_image, pixman_format);

    return &surface->base;
}
it looks like the surface object been created but only return one of its member, I don't know if the surface object has been left behind or it will be collected by some other process. Since IM use Glib, my memory leak detector tool doesn't work anymore. I have to ask you to clarify this one.
Sorry for the million questions I posted in last couple days. This is a major update, my test set files generated lots of problem.
Post Reply