Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.13.0
-
None
-
8e74bf4d4aaaf582c70cbcb83caa237e2592e762 (qt/qtbase/5.15)
Description
Steps:
- Instantiate a Q(Gui)Application
- Delete it
- Instantiate a QCoreApplication
- Create a QImage
- call scaled() on that image
- run the application
Expected:
- No crash
Reality:
- Crash
reproducible with this code:
#include <QApplication>
#include <QImage>
#include <memory>
namespace
{
// Copied from the QT Doc examples.
// https://doc.qt.io/qt-5/qimage.html
QImage createImage()
}
int main(int argc, char *argv[])
{ auto app = std::make_unique<QApplication>(argc, argv); app.reset(); auto core_app = std::make_unique<QCoreApplication>(argc, argv); auto image = createImage(); auto scaled_image = image.scaled(5,5,Qt::KeepAspectRatio); return app->exec(); }