diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index a214b436c0f97..453461c9f28ee 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -584,6 +584,11 @@ PipelineRef ContentContext::GetCachedRuntimeEffectPipeline( void ContentContext::ClearCachedRuntimeEffectPipeline( const std::string& unique_entrypoint_name) const { + // Pipelines may be in use by the GPU when a host reload/restart is + // performed. This wait idle ensures that all pending commands have + // completed before any pipelines are destroyed. + GetContext()->GetIdleWaiter()->WaitIdle(); + for (auto it = runtime_effect_pipelines_.begin(); it != runtime_effect_pipelines_.end();) { if (it->first.unique_entrypoint_name == unique_entrypoint_name) {