From 95794f85209b52775edf4ced980cbe00985fba63 Mon Sep 17 00:00:00 2001 From: Adrian Cojocaru Date: Thu, 25 Sep 2025 20:24:45 +0300 Subject: [PATCH] Manually free bound resources (#3831) --- src/mbgl/gl/context.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 4659190c3..b5a3856bd 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -100,6 +100,8 @@ Context::~Context() noexcept { if (cleanupOnDestruction) { backend.getThreadPool().runRenderJobs(true /* closeQueue */); + glUseProgram(0); + for (size_t i = 0; i < globalUniformBuffers.allocatedSize(); i++) { globalUniformBuffers.set(i, nullptr); } @@ -108,6 +110,7 @@ Context::~Context() noexcept { // Delete all pooled resources while the context is still valid texturePool.reset(); + uboAllocator.reset(); #if !defined(NDEBUG) Log::Debug(Event::General, "Rendering Stats:\n" + stats.toString("\n"));