From 48d39a01a78cdbb6c78133ec958123d7a8f4ae53 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 26 Feb 2013 15:31:23 +0100 Subject: [PATCH] Cocoa: Remove qt_mac_toCGImage warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We got these because we were flushing the backing store with a null QImage. Change-Id: I372cb3fc7c82d3bdcfe735fcadfa72806d0ef39b Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoabackingstore.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm index 7f022da4c3..a2f6910688 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm @@ -90,8 +90,10 @@ void QCocoaBackingStore::flush(QWindow *win, const QRegion ®ion, const QPoint // m_cgImage is only a reference to the data inside m_qImage, it is not a copy. CGImageRelease(m_cgImage); m_cgImage = 0; - if (QCocoaWindow *cocoaWindow = static_cast(win->handle())) - [cocoaWindow->m_contentView flushBackingStore:this region:region offset:offset]; + if (!m_qImage.isNull()) { + if (QCocoaWindow *cocoaWindow = static_cast(win->handle())) + [cocoaWindow->m_contentView flushBackingStore:this region:region offset:offset]; + } } void QCocoaBackingStore::resize(const QSize &size, const QRegion &)