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>bb10
parent
b26dc9bc05
commit
d824c7bcc5
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class QScreen;
|
|||
class QPlatformScreenPrivate
|
||||
{
|
||||
public:
|
||||
QScreen *screen;
|
||||
QPointer<QScreen> screen;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Reference in New Issue