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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user