mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-06 05:01:53 +00:00
Fixed various memory leaks + ModelLoader cleanup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user