Skip to content

Commit

Permalink
[qtdeclarative] Ask rendering thread to release resources when window…
Browse files Browse the repository at this point in the history
… is closed.
  • Loading branch information
dcaliste committed Mar 7, 2019
1 parent f906aba commit a588b2a
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 a588b2a

Please sign in to comment.