summaryrefslogtreecommitdiff
path: root/src/PeerInteractionCommand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/PeerInteractionCommand.cc')
-rw-r--r--src/PeerInteractionCommand.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc
index 677fdc4f..2cd64a27 100644
--- a/src/PeerInteractionCommand.cc
+++ b/src/PeerInteractionCommand.cc
@@ -133,6 +133,7 @@ PeerInteractionCommand::PeerInteractionCommand(int32_t cuid,
setUploadLimit(e->option->getAsInt(PREF_MAX_UPLOAD_LIMIT));
peer->activate();
+ peer->allocateBitfield(btContext->getPieceLength(), btContext->getTotalLength());
maxDownloadSpeedLimit = e->option->getAsInt(PREF_MAX_DOWNLOAD_LIMIT);
@@ -140,6 +141,7 @@ PeerInteractionCommand::PeerInteractionCommand(int32_t cuid,
}
PeerInteractionCommand::~PeerInteractionCommand() {
+ peer->deallocateBitfield();
peer->deactivate();
PEER_OBJECT_CLUSTER(btContext)->unregisterHandle(peer->getId());