summaryrefslogtreecommitdiff
path: root/src/Piece.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-12-26 14:26:55 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-12-26 14:26:55 +0000
commite39f7a7e9ce1e42e7a46332f664d6a6810ee55fa (patch)
tree602f80960c3538968b234725b4e7cdfb5c79ff4d /src/Piece.cc
parenteed41706fc0e72c15b0509f6a93b03644cc06c59 (diff)
2007-12-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Allocate bitfield in Peer when it is really used. More specifically, bitfield in Peer is allocated after the connection is established and deallocated when the connection is dropped. Since 2 parameters(piece length and total length) was removed from the constructor of Peer class, many test classes were modified accordingly. See svn log for more detailed information. * src/PeerInteractionCommand.cc * src/CompactPeerListProcessor.cc * src/Peer.cc * src/DefaultPeerListProcessor.cc * src/PeerListenCommand.cc * src/PeerReceiveHandshakeCommand.cc Fixed memory leak * src/Piece.cc
Diffstat (limited to 'src/Piece.cc')
-rw-r--r--src/Piece.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Piece.cc b/src/Piece.cc
index cabaa8db..4ed9fab7 100644
--- a/src/Piece.cc
+++ b/src/Piece.cc
@@ -105,6 +105,7 @@ string Piece::toString() const {
void Piece::reconfigure(int32_t length)
{
+ delete bitfield;
this->length = length;
bitfield =
BitfieldManFactory::getFactoryInstance()->createBitfieldMan(_blockLength, length);