diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2015-01-20 16:10:26 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-01-24 13:23:54 +0100 |
commit | d824c7bcc546d80eabcdad34c9e2c0178a734858 (patch) | |
tree | 2c2ab8c650a4533a6a6b492be6ec1b50923073fb /src | |
parent | b26dc9bc05a052ddc24c4aa444e87cef9b5564f2 (diff) |
Track QPlatformScreen -> QScreen using QPointer
Allows the QPlatformScreen to verify that the QScreen is alive before
sending events to QPA for the given screen (which will assert if the
screen is being destroyed).
Change-Id: Ie77674fead3e0a4d4f6fedbf1f7f3c98364c7485
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qplatformscreen_p.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiosviewcontroller.mm | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 98755c3a5e..5eedcabd24 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -461,7 +461,6 @@ void QPlatformIntegration::destroyScreen(QPlatformScreen *screen) { QGuiApplicationPrivate::screen_list.removeOne(screen->d_func()->screen); delete screen->d_func()->screen; - screen->d_func()->screen = Q_NULLPTR; delete screen; } diff --git a/src/gui/kernel/qplatformscreen_p.h b/src/gui/kernel/qplatformscreen_p.h index 42a5503461..fb80bfe662 100644 --- a/src/gui/kernel/qplatformscreen_p.h +++ b/src/gui/kernel/qplatformscreen_p.h @@ -52,7 +52,7 @@ class QScreen; class QPlatformScreenPrivate { public: - QScreen *screen; + QPointer<QScreen> screen; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index 84d6628a8a..365de974aa 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -337,6 +337,9 @@ if (!isQtApplication()) return; + if (!m_screen->screen()) + return; + // For now we only care about the main screen, as both the statusbar // visibility and orientation is only appropriate for the main screen. if (m_screen->uiScreen() != [UIScreen mainScreen]) |