summaryrefslogtreecommitdiff
path: root/Bitmap.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Bitmap.cs')
-rw-r--r--Bitmap.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Bitmap.cs b/Bitmap.cs
index 0575497..91eabb9 100644
--- a/Bitmap.cs
+++ b/Bitmap.cs
@@ -123,8 +123,15 @@ class Bitmap : IDisposable
return SerializedData;
}
+ bool disposed = false;
+
public void Dispose()
{
+ if (disposed) return;
Raylib.UnloadTexture(Texture);
+ GC.SuppressFinalize(this);
+ disposed = true;
}
+
+ ~Bitmap() => Dispose();
} \ No newline at end of file