mirror of
https://github.com/lubosz/overte.git
synced 2025-04-17 00:57:44 +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() {
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue