From e4a5b34745c7e80cc50b07afc938a30f03dc8795 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 8 Nov 2018 04:25:43 +0100 Subject: [PATCH] gfx-source-texture: Check for valid child and parent --- source/gfx-source-texture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/gfx-source-texture.cpp b/source/gfx-source-texture.cpp index e199238d..a5a25763 100644 --- a/source/gfx-source-texture.cpp +++ b/source/gfx-source-texture.cpp @@ -114,6 +114,9 @@ std::shared_ptr gfx::source_texture::render(size_t width, size_t he if ((height == 0) || (height >= 16384)) { throw std::runtime_error("Height too large or too small."); } + if (child->destroyed() || parent->destroyed()) { + return nullptr; + } { auto op = render_target->render((uint32_t)width, (uint32_t)height);