[core] Keep BackendScope and context valid when closing the thread pool (#4307)

This commit is contained in:
Adrian Cojocaru
2026-05-25 19:47:26 +03:00
committed by GitHub
parent 9e11772fa8
commit fe1d9112a0
2 changed files with 3 additions and 2 deletions

View File

@@ -68,8 +68,6 @@ Context::Context(RendererBackend& backend_)
Context::~Context() noexcept {
MBGL_VERIFY_THREAD(tid);
backend.getThreadPool().runRenderJobs(true /* closeQueue */);
destroyResources();
{

View File

@@ -634,6 +634,9 @@ void RendererBackend::initCommandPool() {
void RendererBackend::destroyResources() {
if (device) device->waitIdle(dispatcher);
gfx::BackendScope scope(*this, gfx::BackendScope::ScopeType::Implicit);
getThreadPool().runRenderJobs(true /* closeQueue */);
context.reset();
commandPool.reset();