mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Merge pull request #6587 from jherico/rigel
Fix crashes on exit due to poor cleanup
This commit is contained in:
commit
4cbbd252d5
3 changed files with 18 additions and 0 deletions
|
@ -1077,6 +1077,11 @@ void Application::initializeUi() {
|
|||
}
|
||||
|
||||
void Application::paintGL() {
|
||||
// paintGL uses a queued connection, so we can get messages from the queue even after we've quit
|
||||
// and the plugins have shutdown
|
||||
if (_aboutToQuit) {
|
||||
return;
|
||||
}
|
||||
_frameCount++;
|
||||
|
||||
// update fps moving average
|
||||
|
|
|
@ -30,6 +30,12 @@ class PresentThread : public QThread, public Dependency {
|
|||
using Lock = std::unique_lock<Mutex>;
|
||||
public:
|
||||
|
||||
PresentThread() {
|
||||
connect(qApp, &QCoreApplication::aboutToQuit, [this]{
|
||||
_shutdown = true;
|
||||
});
|
||||
}
|
||||
|
||||
~PresentThread() {
|
||||
_shutdown = true;
|
||||
wait();
|
||||
|
@ -99,6 +105,10 @@ public:
|
|||
_context->doneCurrent();
|
||||
}
|
||||
|
||||
_context->makeCurrent();
|
||||
if (_activePlugin) {
|
||||
_activePlugin->uncustomizeContext();
|
||||
}
|
||||
_context->doneCurrent();
|
||||
_context->moveToThread(qApp->thread());
|
||||
}
|
||||
|
|
|
@ -337,6 +337,9 @@ void OffscreenQmlSurface::create(QOpenGLContext* shareContext) {
|
|||
// a timer with a small interval is used to get better performance.
|
||||
_updateTimer.setInterval(MIN_TIMER_MS);
|
||||
connect(&_updateTimer, &QTimer::timeout, this, &OffscreenQmlSurface::updateQuick);
|
||||
QObject::connect(qApp, &QCoreApplication::aboutToQuit, [this]{
|
||||
disconnect(&_updateTimer, &QTimer::timeout, this, &OffscreenQmlSurface::updateQuick);
|
||||
});
|
||||
_updateTimer.start();
|
||||
|
||||
_qmlComponent = new QQmlComponent(_qmlEngine);
|
||||
|
|
Loading…
Reference in a new issue