aboutsummaryrefslogtreecommitdiff
path: root/src/platform/opengl/opengl_device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/opengl/opengl_device.cpp')
-rw-r--r--src/platform/opengl/opengl_device.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/platform/opengl/opengl_device.cpp b/src/platform/opengl/opengl_device.cpp
index c4332fa..8516a3c 100644
--- a/src/platform/opengl/opengl_device.cpp
+++ b/src/platform/opengl/opengl_device.cpp
@@ -2,8 +2,8 @@
#include "core/log.h"
#include "core/hdri_manager.h"
-#include "rendering/shader.h"
-#include "rendering/texture.h"
+#include "shader.h"
+#include "texture.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
@@ -220,6 +220,11 @@ namespace Donut::RHI
}
auto shutdown() -> void override
{
+ // Free the HDRIManager's cached GL cubemaps while our context is
+ // still current (they are static-singleton-owned; letting them
+ // destruct at program exit would glDeleteTextures after the context
+ // is gone and crash on close).
+ HDRIManager::get().clear_cache();
if (m_imgui) { ImGui_ImplOpenGL3_Shutdown(); ImGui_ImplGlfw_Shutdown(); ImGui::DestroyContext(); m_imgui = false; }
if (m_vao) { glDeleteVertexArrays(1, &m_vao); m_vao = 0; }
}