diff --git a/filament/src/details/Renderer.cpp b/filament/src/details/Renderer.cpp index 12cc78a847f..02fe8b70f41 100644 --- a/filament/src/details/Renderer.cpp +++ b/filament/src/details/Renderer.cpp @@ -407,6 +407,9 @@ void FRenderer::endFrame() { driver.debugThreading(); } + FILAMENT_CHECK_PRECONDITION(engine.isValid(mSwapChain)) + << "SwapChain must remain valid until endFrame is called."; + if (mSwapChain) { mSwapChain->commit(driver); mSwapChain = nullptr;