diff --git a/ChangeLog b/ChangeLog index a0b2841e..dcea068c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-21 Tatsuhiro Tsujikawa + + Added comment + * src/RequestGroup.cc + 2009-06-21 Tatsuhiro Tsujikawa In CookieStorage::load() and saveNsFormat(), handle exception diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index 7def1231..7035e987 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -820,6 +820,12 @@ void RequestGroup::releaseRuntimeResource(DownloadEngine* e) SharedHandle btRegistry = e->getBtRegistry(); BtContextHandle btContextInReg = btRegistry->getBtContext(btContext->getInfoHashAsString()); + // Make sure that the registered BtContext's GID is equal to + // this->getGID(). Even if createInitialCommand() throws + // exception without registering this BtContext, after that, this + // method is called. In this case, just finding BtContext using + // infoHash may detect another download's BtContext and deleting + // it from BtRegistry causes Segmentation Fault. if(!btContextInReg.isNull() && btContextInReg->getOwnerRequestGroup()->getGID() == btContext->getOwnerRequestGroup()->getGID()) {