Memory leak in LevelColorsImage??
Posted: 2010-08-30T01:25:53-07:00
HI
I have this problem on v6.6.1 (Windows VS 9.0.30729.1 SP), this is reproducible with next source code, I tried with the deprecate function LevelImageColors with the same result, any idea?
Thank you
jcs
I have this problem on v6.6.1 (Windows VS 9.0.30729.1 SP), this is reproducible with next source code, I tried with the deprecate function LevelImageColors with the same result, any idea?
Thank you
jcs
Code: Select all
//-------------------------------------------------------------------------------
MagickWandGenesis();
MagickWand *imageLeak = NewMagickWand();
PixelWand *p1 = NULL,*p2 = NULL;
p1 = NewPixelWand();
p2 = NewPixelWand();
PixelSetColor(p1, "rgb(10,10,10)");
PixelSetColor(p2, "rgb(140,10,10)");
MagickNewImage(imageLeak, 80, 80, p1 );
MagickPixelPacket mp1,mp2;
PixelGetMagickColor(p1, &mp1);
PixelGetMagickColor(p2, &mp2);
LevelColorsImage(imageLeak->images, &mp2, &mp1, MagickTrue ); //Memory Leak
if (imageLeak != NULL )
imageLeak = DestroyMagickWand(imageLeak );
if (p1 != NULL )
p1 = DestroyPixelWand(p1 );
if (p2 != NULL )
p2 = DestroyPixelWand(p2 );
MagickWandTerminus();
//-------------------------------------------------------------------------------