tomer.vinay86
14th April 2016, 17:34
I am working on multi threading : one thread is capturing the QImage of QWebView as QWebFrame :
void XXXXX::SaveImage(QWebFrame *frame)
{
QImage image(frame->contentsSize(), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::transparent);
QPainter painter(&image);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::TextAntialiasing, true);
painter.setRenderHint(QPainter::SmoothPixmapTransf orm, true);
frame->documentElement().render(&painter);
painter.end();
captureImage.push_back(image);
}
and I use the other thread to popup the Qlist data.
But after 2-3 minutes, my application crashes with the below errors.
qt_pixmapFromWinHBITMAP, failed create image of 1280x720
QWaitCondition: Destroyed while threads are still waiting terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc LEAK: 6 RenderObject LEAK: 1 Page LEAK: 1 Frame LEAK: 2 CachedResource LEAK: 28 WebCoreNode
Anyone have an idea why this error is coming?
void XXXXX::SaveImage(QWebFrame *frame)
{
QImage image(frame->contentsSize(), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::transparent);
QPainter painter(&image);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::TextAntialiasing, true);
painter.setRenderHint(QPainter::SmoothPixmapTransf orm, true);
frame->documentElement().render(&painter);
painter.end();
captureImage.push_back(image);
}
and I use the other thread to popup the Qlist data.
But after 2-3 minutes, my application crashes with the below errors.
qt_pixmapFromWinHBITMAP, failed create image of 1280x720
QWaitCondition: Destroyed while threads are still waiting terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc LEAK: 6 RenderObject LEAK: 1 Page LEAK: 1 Frame LEAK: 2 CachedResource LEAK: 28 WebCoreNode
Anyone have an idea why this error is coming?