[Interest] Error : QImage: out of memory,
Nilesh Kokane
nilesh.kokane05 at gmail.com
Mon Aug 1 16:24:01 CEST 2016
Hello,
I've a function as follows. With this I get QImage: out of memory,
returning null image, I dont allocate heap to QImage anywhere.
but the crash happens at QImage img(cdata, 288, 352,
QImage::Format_RGB888). Any clue.
If the QImage is allocating the memory to the heap internally how to free that?
void AddToQueue(/*param*/)
{
/*
..
*/
QImage ampl_image = convertImageWithImageAdjust(/*param*/);
QImage dist_image = convertImageWithImageAdjust(/*param*/);
emit imageReceived(ampl_image, dist_image, FPS);
}
QImage convertImageWithImageAdjust(/*param*/)
{
/*
..
*/
QImage img(cdata, 288, 352, QImage::Format_RGB888);
img = img.scaled(QSize(288*1.5,352*1.5));
delete[] cdata;
return img;
}
void GestureCamCorder::onImageReceived(const QImage &lImage, const
QImage &distImage)
{
QPixmap tempImage = QPixmap::fromImage(amplImage);
ui->amplImage->setPixmap(tempImage);
}
--
Nilesh Kokane
More information about the Interest
mailing list