Differences From Artifact [b4ba3031a1]:
- File
src/OFStream.m
— part of check-in
[28fe0a104d]
at
2016-05-28 19:42:05
on branch trunk
— OFStream: Free the right variable
This was forgotten when adding the caching optimizations: It still tried
to free _readBuffer instead of _readBufferMemory, which failed as the
sanity checks noticed that _readBuffer is not the pointer that had been
allocated. (user: js, size: 31187) [annotate] [blame] [check-ins using]
To Artifact [48141a71fe]:
- File
src/OFStream.m
— part of check-in
[1de551cb5f]
at
2016-06-07 22:56:28
on branch trunk
— Add support for reusing OFStreams after close
Right now, this is only useful for OFTCPSocket, as this is the only
class so far not establishing the stream in the init method. However,
this adds the general infrastructure to allow reuse to all subclasses of
OFStream. (user: js, size: 31424) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
1534 1535 1536 1537 1538 1539 1540 | [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = readBuffer; _readBufferLength += length; } - (void)close { | > > > | > > > > | > > > | 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 | [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = readBuffer; _readBufferLength += length; } - (void)close { [self freeMemory: _readBufferMemory]; _readBuffer = _readBufferMemory = NULL; _readBufferLength = 0; [self freeMemory: _writeBuffer]; _writeBuffer = NULL; _writeBufferLength = 0; _writeBuffered = false; _waitingForDelimiter = false; _blocking = false; } @end |