From ad3d643bc2603a1f0fc6b5e260d94c69a5fa6aee Mon Sep 17 00:00:00 2001 From: CJ DiMaggio Date: Wed, 20 May 2020 21:18:48 -0400 Subject: [PATCH] Delete DummyMesh when RasterizerStorageDummy is freed (cherry picked from commit 66a294d459cf54f673abd6483b7845daf36aea82) --- drivers/dummy/rasterizer_dummy.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h index 934ca769d46..5f5aa55f251 100644 --- a/drivers/dummy/rasterizer_dummy.h +++ b/drivers/dummy/rasterizer_dummy.h @@ -732,6 +732,13 @@ public: texture_owner.free(p_rid); memdelete(texture); } + + if (mesh_owner.owns(p_rid)) { + // delete the mesh + DummyMesh *mesh = mesh_owner.getornull(p_rid); + mesh_owner.free(p_rid); + memdelete(mesh); + } return true; }