My application streams webcam images to a QWidget
, and then has no need for those images after they've been displayed. The application runs for about a minute or two before giving this error several dozen times and crashing:
QImage: out of memory, returning null image
The QWidget
uses a displayImage(QImage)
method which gets called several times per second. I have a feeling that the image should take a pointer as a parameter, but I have no reasoning to back that up.
How can I ensure that the QImage
s are released from memory?
Note: To create the images, I'm using the technique described in the accepted answer of the SO question how to convert an opencv cv::Mat to qimage .