diff --git a/src/renderer/base/renderer.cpp b/src/renderer/base/renderer.cpp index f686f4cc0a3..9ea4e9040bc 100644 --- a/src/renderer/base/renderer.cpp +++ b/src/renderer/base/renderer.cpp @@ -75,29 +75,30 @@ Renderer::~Renderer() } const auto hr = _PaintFrameForEngine(pEngine); - if (E_PENDING == hr) + if (SUCCEEDED(hr)) { - if (--tries == 0) + break; + } + + LOG_HR_IF(hr, hr != E_PENDING); + + if (--tries == 0) + { + // Stop trying. + _pThread->DisablePainting(); + if (_pfnRendererEnteredErrorState) { - // Stop trying. - _pThread->DisablePainting(); - if (_pfnRendererEnteredErrorState) - { - _pfnRendererEnteredErrorState(); - } - // If there's no callback, we still don't want to FAIL_FAST: the renderer going black - // isn't near as bad as the entire application aborting. We're a component. We shouldn't - // abort applications that host us. - return S_FALSE; + _pfnRendererEnteredErrorState(); } - - // Add a bit of backoff. - // Sleep 150ms, 300ms, 450ms before failing out and disabling the renderer. - Sleep(renderBackoffBaseTimeMilliseconds * (maxRetriesForRenderEngine - tries)); - continue; + // If there's no callback, we still don't want to FAIL_FAST: the renderer going black + // isn't near as bad as the entire application aborting. We're a component. We shouldn't + // abort applications that host us. + return S_FALSE; } - LOG_IF_FAILED(hr); - break; + + // Add a bit of backoff. + // Sleep 150ms, 300ms, 450ms before failing out and disabling the renderer. + Sleep(renderBackoffBaseTimeMilliseconds * (maxRetriesForRenderEngine - tries)); } }