[core] Keep BackendScope and context valid when closing the thread pool (#4307)
This commit is contained in:
@@ -68,8 +68,6 @@ Context::Context(RendererBackend& backend_)
|
||||
Context::~Context() noexcept {
|
||||
MBGL_VERIFY_THREAD(tid);
|
||||
|
||||
backend.getThreadPool().runRenderJobs(true /* closeQueue */);
|
||||
|
||||
destroyResources();
|
||||
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user