Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
- Posts: 1
- Joined: 2018-01-10T18:43:09-07:00
- Authentication code: 1152
I am writing a c++ code and trying to crop an image. However, it fails at the initialisation after a few iterations.
The function is being called in a library inside a loop and it works fine a few times (twice).
Is there any way of deallocating the memory after operations have been performed on an image ?
My code is below:
Code: Select all
imageMagic.crop(Geometry(699, 150, 198, 625));
is theer anything like image.dealloc or something which frees up the memory every time it has been used ?
- Posts: 11087
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Your code doesn't have a loop.
My understanding is that Magick++ will automatically free memory (by "destructor") for an Image structure when it is no longer a valid reference. So the placement of what is inside or outside the loop is important.