How to clear or clean up a QIMage
Following method of mine get a const reference to a QIMage
.
MyMethod(const QImage & img) {
// save it to a file
img.save("/path/to/save/the/qimage");
// now I want to clan up img from memory. How should I do it?
}
Question:
How should I clean up the QImage
object from memory after use?
Note:
Note that it is a const & QImage
. So, answer would involve casting the QImage
into non-const?
Also, I am looking at trying to get a QImageData
pointer to the data & delete it. Not sure if that is the correct approach here. Do suggest.