← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2784: Fix signal vs remove order

 

------------------------------------------------------------
revno: 2784
fixes bug: https://launchpad.net/bugs/910599
committer: Jacek Sieka <arnetheduck@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Sun 2012-01-01 21:05:49 +0100
message:
  Fix signal vs remove order
modified:
  dcpp/QueueManager.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/QueueManager.cpp'
--- dcpp/QueueManager.cpp	2012-01-01 14:59:37 +0000
+++ dcpp/QueueManager.cpp	2012-01-01 20:05:49 +0000
@@ -27,12 +27,9 @@
 #include "ConnectionManager.h"
 #include "Download.h"
 #include "FileReader.h"
-#include "FilteredFile.h"
-#include "FinishedItem.h"
 #include "FinishedManager.h"
 #include "HashManager.h"
 #include "LogManager.h"
-#include "MerkleTreeOutputStream.h"
 #include "SearchManager.h"
 #include "SearchResult.h"
 #include "SFVReader.h"
@@ -1029,9 +1026,9 @@
 		} else { // Finished
 			if(d->getType() == Transfer::TYPE_PARTIAL_LIST) {
 				userQueue.remove(q);
-				fileQueue.remove(q);
 				fire(QueueManagerListener::PartialList(), d->getHintedUser(), d->getPFS());
 				fire(QueueManagerListener::Removed(), q);
+				fileQueue.remove(q);
 			} else if(d->getType() == Transfer::TYPE_TREE) {
 				// Got a full tree, now add it to the HashManager
 				dcassert(d->getTreeValid());
@@ -1061,8 +1058,8 @@
 				userQueue.remove(q);
 				fire(QueueManagerListener::Finished(), q, dir, d->getAverageSpeed());
 
+				fire(QueueManagerListener::Removed(), q);
 				fileQueue.remove(q);
-				fire(QueueManagerListener::Removed(), q);
 			} else if(d->getType() == Transfer::TYPE_FILE) {
 				q->addSegment(d->getSegment());
 
@@ -1084,8 +1081,8 @@
 					if(BOOLSETTING(KEEP_FINISHED_FILES)) {
 						fire(QueueManagerListener::StatusUpdated(), q);
 					} else {
+						fire(QueueManagerListener::Removed(), q);
 						fileQueue.remove(q);
-						fire(QueueManagerListener::Removed(), q);
 					}
 				} else {
 					userQueue.removeDownload(q, d->getUser());