Skip to content

Commit

Permalink
Don't crash when platform plugin sends us two close events.
Browse files Browse the repository at this point in the history
Change-Id: Icfe2954908fad2abfb4195fc535aadd1e6302f76
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
  • Loading branch information
sletta authored and The Qt Project committed May 15, 2014
1 parent 1ae7c76 commit cd910e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/kernel/qwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit cd910e9

Please sign in to comment.