grijjy / GrijjyFoundation

Foundation classes used by other Grijjy repositories
Other
244 stars 86 forks source link

FIX: delete buffer inside TThreadSafeBuffer.Read #40

Closed biot2 closed 3 years ago

biot2 commented 3 years ago

In Line 641

Move(FBuffer[Size], FBuffer[0], FSize - ALength);

changed to:

Move(FBuffer[ALength], FBuffer[0], FSize - ALength);
allendrennan commented 3 years ago

The purpose of this Move operation is to shift the remaining buffer to position [0] if there is more buffer remaining than the requested ALength. Please let us know why you think this is an issue.

biot2 commented 3 years ago

In delete buffer block you are planing to delete ALength bytes from the start of FBuffer, but you incorrectly delete Size bytes. My suggestion would fix the code.