Skip to content

Commit

Permalink
Merge branch 'close' into 'mer-5.6'
Browse files Browse the repository at this point in the history
[qtdeclarative] Ask rendering thread to release resources when window is closed.

See merge request mer-core/qtdeclarative!25
  • Loading branch information
chriadam committed Apr 16, 2019
2 parents f906aba + a588b2a commit faf3e4b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/quick/items/qquickwindow.cpp
Expand Up @@ -1470,6 +1470,14 @@ bool QQuickWindow::event(QEvent *e)
emit closing(&qev);
e->setAccepted(qev.isAccepted());
} break;
case QEvent::PlatformSurface:
if ((static_cast<QPlatformSurfaceEvent *>(e))->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed) {
// Ensure that the rendering thread is notified before
// the QPlatformWindow is destroyed.
if (d->windowManager)
d->windowManager->hide(this);
}
break;
case QEvent::FocusAboutToChange:
#ifndef QT_NO_IM
if (d->activeFocusItem)
Expand Down

0 comments on commit faf3e4b

Please sign in to comment.