Fixed various memory leaks + ModelLoader cleanup

This commit is contained in:
Simon Lübeß
2021-10-14 20:47:25 +02:00
parent cd82a99450
commit 84df8c111b
5 changed files with 57 additions and 229 deletions
+24 -2
View File
@@ -1,7 +1,29 @@
using System;
using GlitchyEngine.World;
namespace GlitchyEngine.Renderer
{
public struct MeshComponent
public struct MeshComponent : IDisposableComponent
{
public GeometryBinding Mesh;
private GeometryBinding _mesh;
public GeometryBinding Mesh
{
[Inline]
get => _mesh;
set mut
{
if(_mesh == value)
return;
SetReference!(_mesh, value);
}
}
public static void DisposeComponent(void* component)
{
Self* self = (Self*)component;
ReleaseRefAndNullify!(self._mesh);
}
}
}