mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 12:33:27 +02:00
Application: guard idle from being called within paintGL()
This commit is contained in:
parent
ce47f83288
commit
0f31c3da10
1 changed files with 10 additions and 11 deletions
|
@ -1374,6 +1374,15 @@ void Application::initializeUi() {
|
||||||
|
|
||||||
void Application::paintGL() {
|
void Application::paintGL() {
|
||||||
|
|
||||||
|
// Some plugins process message events, potentially leading to
|
||||||
|
// re-entering a paint event. don't allow further processing if this
|
||||||
|
// happens
|
||||||
|
if (_inPaint) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_inPaint = true;
|
||||||
|
Finally clearFlagLambda([this] { _inPaint = false; });
|
||||||
|
|
||||||
// paintGL uses a queued connection, so we can get messages from the queue even after we've quit
|
// paintGL uses a queued connection, so we can get messages from the queue even after we've quit
|
||||||
// and the plugins have shutdown
|
// and the plugins have shutdown
|
||||||
if (_aboutToQuit) {
|
if (_aboutToQuit) {
|
||||||
|
@ -1406,15 +1415,6 @@ void Application::paintGL() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some plugins process message events, potentially leading to
|
|
||||||
// re-entering a paint event. don't allow further processing if this
|
|
||||||
// happens
|
|
||||||
if (_inPaint) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_inPaint = true;
|
|
||||||
Finally clearFlagLambda([this] { _inPaint = false; });
|
|
||||||
|
|
||||||
auto displayPlugin = getActiveDisplayPlugin();
|
auto displayPlugin = getActiveDisplayPlugin();
|
||||||
// FIXME not needed anymore?
|
// FIXME not needed anymore?
|
||||||
_offscreenContext->makeCurrent();
|
_offscreenContext->makeCurrent();
|
||||||
|
@ -2494,11 +2494,10 @@ static uint32_t _renderedFrameIndex { INVALID_FRAME };
|
||||||
|
|
||||||
void Application::idle(uint64_t now) {
|
void Application::idle(uint64_t now) {
|
||||||
|
|
||||||
if (_aboutToQuit) {
|
if (_aboutToQuit || _inPaint) {
|
||||||
return; // bail early, nothing to do here.
|
return; // bail early, nothing to do here.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
checkChangeCursor();
|
checkChangeCursor();
|
||||||
|
|
||||||
Stats::getInstance()->updateStats();
|
Stats::getInstance()->updateStats();
|
||||||
|
|
Loading…
Reference in a new issue