Manually free bound resources (#3831)

This commit is contained in:
Adrian Cojocaru
2025-09-25 20:24:45 +03:00
committed by GitHub
parent bb42ed111b
commit 95794f8520

View File

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