From c1291c0412a1a2846894304bd363c7c8486f52f0 Mon Sep 17 00:00:00 2001 From: Alberto Torres Date: Fri, 13 Sep 2024 18:43:01 +0200 Subject: [PATCH] Destroy cubemaps with the scene. --- src/scene.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scene.nim b/src/scene.nim index 81104dd..a5f8a74 100644 --- a/src/scene.nim +++ b/src/scene.nim @@ -351,6 +351,11 @@ proc destroy*(self: Scene) = self.shadow_maps.destroy() for ubo in self.lighting_UBOs: ubo.destroy() + if self.background_cubemap != nil: + self.background_cubemap.destroy() + for cube in self.cubemaps: + cube.destroy() + self.cubemaps = @[] self.engine.scenes.del(self.name) # bound textures can linger unbindAllTextures()