I have this in a loop
Image image(mWidth,mHeight,"RGB",CharPixel,rgbImage);
image.rotate(90);
image.write(0,0,mHeight,mWidth,"RGB",CharPixel,pushImage);
Memory is not being freed up and I dont quite understand how to do so?
This also does not work
Image * image;
image = new Image(mWidth,mHeight,"RGB",CharPixel,rgbImage);
image->rotate(90);
image->write(0,0,mHeight,mWidth,"RGB",CharPixel,pushImage);
delete image;
I though the imagemagick manual says its not need but that is not the case here.
how to destory image ?
Re: how to destory image ?
De-referenced images are automagically deleted. Run your code in a loop for example 1000 iterations. If the memory stays more or less constant, it suggests the image is deleted as expected. If the memory consumption uniformly increases, that suggests a memory leak.
Re: how to destory image ?
UPDATE:: Never mind, something unrelated, over looked.
- This is precisely how I arrived at this quandary.De-referenced images are automagically deleted. Run your code in a loop for example 1000 iterations. If the memory stays more or less constant, it suggests the image is deleted as expected. If the memory consumption uniformly increases, that suggests a memory leak.