summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/ios/qiosbackingstore.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm
index 71f14fdd91..6cefc03377 100644
--- a/src/plugins/platforms/ios/qiosbackingstore.mm
+++ b/src/plugins/platforms/ios/qiosbackingstore.mm
@@ -60,6 +60,7 @@ QIOSBackingStore::QIOSBackingStore(QWindow *window)
QIOSBackingStore::~QIOSBackingStore()
{
delete m_context;
+ delete m_device;
}
void QIOSBackingStore::beginPaint(const QRegion &)
@@ -68,7 +69,8 @@ void QIOSBackingStore::beginPaint(const QRegion &)
window()->setSurfaceType(QSurface::OpenGLSurface);
m_context->makeCurrent(window());
- m_device = new QOpenGLPaintDevice(window()->size());
+ if (!m_device)
+ m_device = new QOpenGLPaintDevice(window()->size());
}
QPaintDevice *QIOSBackingStore::paintDevice()
@@ -86,8 +88,6 @@ void QIOSBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
void QIOSBackingStore::endPaint()
{
- delete m_device;
-
// Calling makeDone() on the context here would be an option,
// but is not needed, and would actually add some overhead.
}