From d6a9783b71ea1749a071d57400692717f6935de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 1 Sep 2020 18:41:23 +0200 Subject: Cleanup: GLFrameBuffer: Reduce indentation --- source/blender/gpu/opengl/gl_framebuffer.cc | 32 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'source/blender/gpu/opengl/gl_framebuffer.cc') diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index c97f4e2a270..8d48c9f8de3 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -74,21 +74,23 @@ GLFrameBuffer::GLFrameBuffer( GLFrameBuffer::~GLFrameBuffer() { - if (context_ != NULL) { - if (context_ == GPU_context_active_get()) { - /* Context might be partially freed. This happens when destroying the window framebuffers. */ - glDeleteFramebuffers(1, &fbo_id_); - } - else { - context_->fbo_free(fbo_id_); - } - /* Restore default framebuffer if this framebuffer was bound. */ - if (context_->active_fb == this && context_->back_left != this) { - /* If this assert triggers it means the framebuffer is being freed while in use by another - * context which, by the way, is TOTALLY UNSAFE!!! */ - BLI_assert(context_ == GPU_context_active_get()); - GPU_framebuffer_restore(); - } + if (context_ == NULL) { + return; + } + + if (context_ == GPU_context_active_get()) { + /* Context might be partially freed. This happens when destroying the window framebuffers. */ + glDeleteFramebuffers(1, &fbo_id_); + } + else { + context_->fbo_free(fbo_id_); + } + /* Restore default framebuffer if this framebuffer was bound. */ + if (context_->active_fb == this && context_->back_left != this) { + /* If this assert triggers it means the framebuffer is being freed while in use by another + * context which, by the way, is TOTALLY UNSAFE!!! */ + BLI_assert(context_ == GPU_context_active_get()); + GPU_framebuffer_restore(); } } -- cgit v1.2.3