From 02572884f48397b4e0669cdafc7660b06c760f1e Mon Sep 17 00:00:00 2001 From: Dimitris Nikolaidis Date: Mon, 28 Mar 2022 22:04:13 +0300 Subject: [PATCH] Fix canvas_group not being freed in RendererCanvasCull::free --- servers/rendering/renderer_canvas_cull.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index 56eaa396c81..22149c9e437 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -1664,6 +1664,11 @@ bool RendererCanvasCull::free(RID p_rid) { } */ + if (canvas_item->canvas_group != nullptr) { + memdelete(canvas_item->canvas_group); + canvas_item->canvas_group = nullptr; + } + canvas_item_owner.free(p_rid); } else if (canvas_light_owner.owns(p_rid)) {