Rewinder - when reallocating buffer, make sure we have released all references to the old buffer first to free up memory for the new buffer.
This commit is contained in:
parent
bcb6b20ec2
commit
423376835c
|
@ -235,12 +235,14 @@ namespace BizHawk.Client.Common
|
|||
// if we have an appropriate buffer free, return it
|
||||
if (_rewindBufferBacking != null)
|
||||
{
|
||||
var buf = _rewindBufferBacking;
|
||||
_rewindBufferBacking = null;
|
||||
if (buf.LongLength == size)
|
||||
if (_rewindBufferBacking.LongLength == size)
|
||||
{
|
||||
var buf = _rewindBufferBacking;
|
||||
_rewindBufferBacking = null;
|
||||
return buf;
|
||||
}
|
||||
|
||||
_rewindBufferBacking = null;
|
||||
}
|
||||
|
||||
// otherwise, allocate it
|
||||
|
|
|
@ -65,6 +65,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
long capacity = 0;
|
||||
_mBufferManage(_mAllocatedBuffer, ref capacity, false);
|
||||
_mAllocatedBuffer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue