summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-29 23:36:50 +0200
committerGitHub <noreply@github.com>2022-03-29 23:36:50 +0200
commit0731d0d777a67a3dba862eab61883a4d94b00f61 (patch)
treeb79ad8232d06b19e28032432ca9a8a6429e2b31f
parent04c17eb00389dff7add0459a5a4dd6e2886d3f05 (diff)
parent02572884f48397b4e0669cdafc7660b06c760f1e (diff)
Merge pull request #59671 from dnikolaidis2/fix-canvas-group-memory-leak
Fix canvas_group not being freed in RendererCanvasCull::free
-rw-r--r--servers/rendering/renderer_canvas_cull.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp
index 56eaa396c8..22149c9e43 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)) {