mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-01 16:28:36 -04:00
ByteStream is a ref struct so it gets copied around freely, and we give the buffer back to the pool on Dispose. problem is a copy you took before disposing still points at that buffer, so it can read whatever gets written into it next. To fix this we version each buffer and assign a shared owner that gets invalidated as soon as one copy disposes the bytestream.
21 KiB
21 KiB