Ensure we don't get trapped in the QML rendering loop on shutdown

This commit is contained in:
Brad Davis 2016-03-09 11:32:37 -08:00
parent 975f0f049c
commit b2be54a179

View file

@ -326,6 +326,10 @@ OffscreenQmlSurface::~OffscreenQmlSurface() {
void OffscreenQmlSurface::onAboutToQuit() {
QObject::disconnect(&_updateTimer);
// Disconnecting the update timer is insufficient, since the renderer
// may attempting to render already, so we need to explicitly tell the renderer
// to stop
_renderer->aboutToQuit();
}
void OffscreenQmlSurface::create(QOpenGLContext* shareContext) {
@ -486,6 +490,9 @@ void OffscreenQmlSurface::updateQuick() {
QMutexLocker lock(&(_renderer->_mutex));
_renderer->post(RENDER);
while (!_renderer->_cond.wait(&(_renderer->_mutex), 100)) {
if (_renderer->_quit) {
return;
}
qApp->processEvents();
}
_render = false;