Fix #131135: Vulkan: Crash closing window

When a main window contains a child window and the main window is closed
it can crash as the context isn't available when destructing the
VKFramebuffer of the child window.

Pull Request: https://projects.blender.org/blender/blender/pulls/131137
This commit is contained in:
Jeroen Bakker
2024-11-29 09:11:13 +01:00
parent 61d4f7359b
commit 71ec30fce9

View File

@@ -38,9 +38,9 @@ VKFrameBuffer::VKFrameBuffer(const char *name)
VKFrameBuffer::~VKFrameBuffer()
{
VKContext &context = *VKContext::get();
if (context.active_framebuffer_get() == this) {
context.deactivate_framebuffer();
VKContext *context = VKContext::get();
if (context && context->active_framebuffer_get() == this) {
context->deactivate_framebuffer();
}
render_pass_free();
}