mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:18:24 +02:00
Ensure we don't get trapped in the QML rendering loop on shutdown
This commit is contained in:
parent
975f0f049c
commit
b2be54a179
1 changed files with 7 additions and 0 deletions
|
@ -326,6 +326,10 @@ OffscreenQmlSurface::~OffscreenQmlSurface() {
|
||||||
|
|
||||||
void OffscreenQmlSurface::onAboutToQuit() {
|
void OffscreenQmlSurface::onAboutToQuit() {
|
||||||
QObject::disconnect(&_updateTimer);
|
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) {
|
void OffscreenQmlSurface::create(QOpenGLContext* shareContext) {
|
||||||
|
@ -486,6 +490,9 @@ void OffscreenQmlSurface::updateQuick() {
|
||||||
QMutexLocker lock(&(_renderer->_mutex));
|
QMutexLocker lock(&(_renderer->_mutex));
|
||||||
_renderer->post(RENDER);
|
_renderer->post(RENDER);
|
||||||
while (!_renderer->_cond.wait(&(_renderer->_mutex), 100)) {
|
while (!_renderer->_cond.wait(&(_renderer->_mutex), 100)) {
|
||||||
|
if (_renderer->_quit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
}
|
}
|
||||||
_render = false;
|
_render = false;
|
||||||
|
|
Loading…
Reference in a new issue