diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index af99d71d30..76eb8569fb 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1374,6 +1374,15 @@ void Application::initializeUi() { 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 // and the plugins have shutdown if (_aboutToQuit) { @@ -1406,15 +1415,6 @@ void Application::paintGL() { 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(); // FIXME not needed anymore? _offscreenContext->makeCurrent(); @@ -2494,11 +2494,10 @@ static uint32_t _renderedFrameIndex { INVALID_FRAME }; void Application::idle(uint64_t now) { - if (_aboutToQuit) { + if (_aboutToQuit || _inPaint) { return; // bail early, nothing to do here. } - checkChangeCursor(); Stats::getInstance()->updateStats();