From b9eab8984d482b7ffdab640b9d2aa53c5522bfba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 12 Jan 2015 17:32:54 +0100 Subject: iOS: Use QPlatformIntegration::destroyScreen() instead of manual delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8128fa1a4b7d6d202d15c03d51f6360a74d75d8c Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosintegration.h | 2 ++ src/plugins/platforms/ios/qiosscreen.mm | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qiosintegration.h b/src/plugins/platforms/ios/qiosintegration.h index 85338b1c4d..d3474597e1 100644 --- a/src/plugins/platforms/ios/qiosintegration.h +++ b/src/plugins/platforms/ios/qiosintegration.h @@ -76,7 +76,9 @@ public: QTouchDevice *touchDevice(); QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; + // Called from Objective-C class QIOSScreenTracker, which can't be friended void addScreen(QPlatformScreen *screen) { screenAdded(screen); } + void destroyScreen(QPlatformScreen *screen) { QPlatformIntegration::destroyScreen(screen); } static QIOSIntegration *instance(); diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 712bf0098b..43bfed5cbb 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -92,7 +92,8 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen) QIOSScreen *screen = qtPlatformScreenFor([notification object]); Q_ASSERT_X(screen, Q_FUNC_INFO, "Screen disconnected that we didn't know about"); - delete screen; + QIOSIntegration *integration = QIOSIntegration::instance(); + integration->destroyScreen(screen); } + (void)screenModeChanged:(NSNotification*)notification -- cgit v1.2.3