summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/minimal/qminimalintegration.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-04-06 12:11:36 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-04-08 21:10:57 +0200
commit9901d39ea6012621350a4e2a3f1466803c60829e (patch)
tree52a4c200068ff1a056e99f6e7f803d51913b44c5 /src/plugins/platforms/minimal/qminimalintegration.cpp
parent14c55e29794b4f1d6e010fdf7082ef55cbf8f275 (diff)
Minimal platform: fix leaking QMinimalScreen instance
This caused false alarms in fuzzing tests. The lifetime of the screen is the same as that of QMinimalIntegration. But failure to call handleScreenRemoved() also causes a warning; so as on "normal" platforms, the screen has to be separately allocated. Change-Id: Iad0cc53b8d09687400ced28bc2353b7500b01110 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Diffstat (limited to 'src/plugins/platforms/minimal/qminimalintegration.cpp')
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
index f457f69f11..0c2c0d0b68 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
+++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
@@ -103,17 +103,18 @@ QMinimalIntegration::QMinimalIntegration(const QStringList &parameters)
m_options |= DebugBackingStore | EnableFonts;
}
- QMinimalScreen *mPrimaryScreen = new QMinimalScreen();
+ m_primaryScreen = new QMinimalScreen();
- mPrimaryScreen->mGeometry = QRect(0, 0, 240, 320);
- mPrimaryScreen->mDepth = 32;
- mPrimaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied;
+ m_primaryScreen->mGeometry = QRect(0, 0, 240, 320);
+ m_primaryScreen->mDepth = 32;
+ m_primaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied;
- QWindowSystemInterface::handleScreenAdded(mPrimaryScreen);
+ QWindowSystemInterface::handleScreenAdded(m_primaryScreen);
}
QMinimalIntegration::~QMinimalIntegration()
{
+ QWindowSystemInterface::handleScreenRemoved(m_primaryScreen);
delete m_fontDatabase;
}