[GUI] One more bugfix

- bugfix for 44a1240f5f
This commit is contained in:
VaDiM 2023-04-13 19:51:57 +03:00
parent 90ec395b2a
commit 4bae98813b

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;
}