Page 1 of 1

possible memory leak in cairo?

Posted: 2014-02-07T11:25:16-07:00
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.