Skip to content

Commit ebbe32b

Browse files
committed
Refactor ZCharArray - clear array on disposal
`ZCharArray` now ensures the buffer is always returned to the pool with `clearArray: true`.
1 parent c14283f commit ebbe32b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/SmartFormat/ZString/ZCharArray.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public void Dispose()
273273
{
274274
if (_isDisposed) return;
275275

276-
Pool.Return(_bufferArray, clearArray: true);
277-
_isDisposed = true;
276+
Pool.Return(_bufferArray!, clearArray: true);
277+
_bufferArray = null;
278278
}
279279
}

0 commit comments

Comments
 (0)