Memory Leak Fixed

Have to free the mesh generator after we process our mesh.
This commit is contained in:
2025-11-20 13:50:47 -05:00
parent 9f5183bed2
commit 1fa5551ba7
5 changed files with 8 additions and 3 deletions

View File

@@ -93,6 +93,8 @@ func _draw():
var meshGenerator = GeoPolyMesh.new(vector_indexes, vectors, extrusion_direction, depth)
var commited_mesh = meshGenerator.commit_mesh(meshInstance3d.get_active_material(0))
meshGenerator.free()
meshInstance3d.mesh = commited_mesh
meshInstance3d.position += depth_position_offset
@@ -112,6 +114,7 @@ func _re_draw():
var meshGenerator = GeoPolyMesh.new(vector_indexes, vectors, extrusion_direction, depth)
var commited_mesh = meshGenerator.commit_mesh(meshInstance3d.get_active_material(0))
meshGenerator.free()
meshInstance3d.mesh = commited_mesh
meshInstance3d.create_trimesh_collision()