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"));