Geometry is automatically disposed of with OOTB nodes, so it wouldn’t be a problem
@salvatoredragotta refer to michaels link above. It can be done in C# too.