Browse Source

2009-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Added comment
	* src/RequestGroup.cc
Tatsuhiro Tsujikawa 16 years ago
parent
commit
a60ba71f1e
2 changed files with 11 additions and 0 deletions
  1. 5 0
      ChangeLog
  2. 6 0
      src/RequestGroup.cc

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2009-06-21  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Added comment
+	* src/RequestGroup.cc
+
 2009-06-21  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	In CookieStorage::load() and saveNsFormat(), handle exception

+ 6 - 0
src/RequestGroup.cc

@@ -820,6 +820,12 @@ void RequestGroup::releaseRuntimeResource(DownloadEngine* e)
     SharedHandle<BtRegistry> 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()) {