[GUI] One more bugfix

- bugfix for https://github.com/aelurum/AssetStudio/commit/44a1240f5fd4bc404173c34fe0c02796e527d595
This commit is contained in:
VaDiM
2023-04-13 22:08:01 +03:00
parent 90ec395b2a
commit 4bae98813b
+3 -4
View File
@@ -14,12 +14,10 @@ namespace AssetStudioGUI
{
Width = image.Width;
Height = image.Height;
var buff = BigArrayPool<byte>.Shared.Rent(Width * Height * 4);
image.CopyPixelDataTo(buff);
Bits = buff;
Bits = BigArrayPool<byte>.Shared.Rent(Width * Height * 4);
image.CopyPixelDataTo(Bits);
m_handle = GCHandle.Alloc(Bits, GCHandleType.Pinned);
m_bitmap = new Bitmap(Width, Height, Stride, PixelFormat.Format32bppArgb, m_handle.AddrOfPinnedObject());
BigArrayPool<byte>.Shared.Return(buff);
}
private void Dispose(bool disposing)
@@ -28,6 +26,7 @@ namespace AssetStudioGUI
{
m_bitmap.Dispose();
m_handle.Free();
BigArrayPool<byte>.Shared.Return(Bits);
}
m_bitmap = null;
}