Report memory leak when process svg without delegate
Posted: 2013-12-23T12:39:26-07:00
Magic, Merry Christmas. again, apologize for multiple topic.
Testing file.
http://upload.wikimedia.org/wikipedia/c ... VS_SVG.svg
I run under the windows and can't install any svg delegate. From my understand, ImageMagick will convert the svg to MVG, and draw the image out. I maybe wrong
Anyway, I experience several memory leak. So far, I can only figure out one.
It is in svg.c file
static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
…
if (LocaleCompare(image_info->magick,"MSVG") != 0)
{
const DelegateInfo
*delegate_info;
delegate_info=GetDelegateInfo("svg:decode",(char *) NULL,exception);
……
}
…..
}
After calling delegate_info=GetDelegateInfo("svg:decode",(char *) NULL,exception);
since I don’t have any svg delegate installed, so there will be a warning message in the exception, which will be overwritten later without properly delete.
I add two line code after call GetDelegateInfo
/** this is a temporary fix to get rid of the exception which generated by call Getdelegateinfo.*/
DestroyExceptionInfo(exception);
exception = AcquireExceptionInfo();
This is not a good fix. It throws the warning out directly, hope you can give me some input how to fix this.
I also experience the font name list of system been left behind. I can’t figure out the reason and several small memory leak as well. Hope you can reproduce the leak and give me some input.
My OS is window 8,
IM package is 6.8.4. (Unable to update at this moment, since it close to our product release.)
thanks for the help.
Testing file.
http://upload.wikimedia.org/wikipedia/c ... VS_SVG.svg
I run under the windows and can't install any svg delegate. From my understand, ImageMagick will convert the svg to MVG, and draw the image out. I maybe wrong
Anyway, I experience several memory leak. So far, I can only figure out one.
It is in svg.c file
static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
…
if (LocaleCompare(image_info->magick,"MSVG") != 0)
{
const DelegateInfo
*delegate_info;
delegate_info=GetDelegateInfo("svg:decode",(char *) NULL,exception);
……
}
…..
}
After calling delegate_info=GetDelegateInfo("svg:decode",(char *) NULL,exception);
since I don’t have any svg delegate installed, so there will be a warning message in the exception, which will be overwritten later without properly delete.
I add two line code after call GetDelegateInfo
/** this is a temporary fix to get rid of the exception which generated by call Getdelegateinfo.*/
DestroyExceptionInfo(exception);
exception = AcquireExceptionInfo();
This is not a good fix. It throws the warning out directly, hope you can give me some input how to fix this.
I also experience the font name list of system been left behind. I can’t figure out the reason and several small memory leak as well. Hope you can reproduce the leak and give me some input.
My OS is window 8,
IM package is 6.8.4. (Unable to update at this moment, since it close to our product release.)
thanks for the help.