Don't crash when platform plugin sends us two close events.
Change-Id: Icfe2954908fad2abfb4195fc535aadd1e6302f76 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
parent
1ae7c76b2a
commit
cd910e9254
@ -1522,6 +1522,9 @@ void QWindow::resize(const QSize &newSize)
|
||||
void QWindow::destroy()
|
||||
{
|
||||
Q_D(QWindow);
|
||||
if (!d->platformWindow)
|
||||
return;
|
||||
|
||||
QObjectList childrenWindows = children();
|
||||
for (int i = 0; i < childrenWindows.size(); i++) {
|
||||
QObject *object = childrenWindows.at(i);
|
||||
@ -1791,6 +1794,9 @@ bool QWindow::close()
|
||||
if (parent())
|
||||
return false;
|
||||
|
||||
if (!d->platformWindow)
|
||||
return true;
|
||||
|
||||
if (QGuiApplicationPrivate::focus_window == this)
|
||||
QGuiApplicationPrivate::focus_window = 0;
|
||||
if (QGuiApplicationPrivate::currentMouseWindow == this)
|
||||
|
Loading…
Reference in New Issue
Block a user