File tree 4 files changed +18
-8
lines changed
4 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ cmake_minimum_required(VERSION 3.2)
22
22
# There is no C per se in WDT but if you use CXX only here many checks fail
23
23
# Version is Major.Minor.YYMMDDX for up to 10 releases per day
24
24
# Minor currently is also the protocol version - has to match with Protocol.cpp
25
- project ("WDT" LANGUAGES C CXX VERSION 1.19.1509160 )
25
+ project ("WDT" LANGUAGES C CXX VERSION 1.19.1509200 )
26
26
27
27
# On MacOS this requires the latest (master) CMake (and/or CMake 3.1.1/3.2)
28
28
set (CMAKE_CXX_STANDARD 11)
Original file line number Diff line number Diff line change @@ -128,6 +128,14 @@ bool DirectorySourceQueue::setRootDir(const string &newRootDir) {
128
128
return true ;
129
129
}
130
130
131
+ void DirectorySourceQueue::clearSourceQueue () {
132
+ // clear current content of the queue. For some reason, priority_queue does
133
+ // not have a clear method
134
+ while (!sourceQueue_.empty ()) {
135
+ sourceQueue_.pop ();
136
+ }
137
+ }
138
+
131
139
void DirectorySourceQueue::setPreviouslyReceivedChunks (
132
140
std::vector<FileChunksInfo> &previouslyTransferredChunks) {
133
141
std::unique_lock<std::mutex> lock (mutex_);
@@ -142,11 +150,7 @@ void DirectorySourceQueue::setPreviouslyReceivedChunks(
142
150
previouslyTransferredChunks_.insert (
143
151
std::make_pair (chunkInfo.getFileName (), std::move (chunkInfo)));
144
152
}
145
- // clear current content of the queue. For some reason, priority_queue does
146
- // not have a clear method
147
- while (!sourceQueue_.empty ()) {
148
- sourceQueue_.pop ();
149
- }
153
+ clearSourceQueue ();
150
154
std::vector<SourceMetaData *> discoveredFileData = std::move (sharedFileData_);
151
155
// recreate the queue
152
156
for (const auto fileData : discoveredFileData) {
@@ -157,6 +161,9 @@ void DirectorySourceQueue::setPreviouslyReceivedChunks(
157
161
}
158
162
159
163
DirectorySourceQueue::~DirectorySourceQueue () {
164
+ // need to remove all the sources because they access metadata at the
165
+ // destructor.
166
+ clearSourceQueue ();
160
167
for (SourceMetaData *fileData : sharedFileData_) {
161
168
delete fileData;
162
169
}
Original file line number Diff line number Diff line change @@ -271,6 +271,9 @@ class DirectorySourceQueue : public SourceQueue {
271
271
*/
272
272
void smartNotify (int32_t addedSource);
273
273
274
+ // / Removes all elements from the source queue
275
+ void clearSourceQueue ();
276
+
274
277
// / root directory to recurse on if fileInfo_ is empty
275
278
std::string rootDir_;
276
279
Original file line number Diff line number Diff line change 8
8
9
9
#define WDT_VERSION_MAJOR 1
10
10
#define WDT_VERSION_MINOR 19
11
- #define WDT_VERSION_BUILD 1509160
11
+ #define WDT_VERSION_BUILD 1509200
12
12
// Add -fbcode to version str
13
- #define WDT_VERSION_STR "1.19.1509160 -fbcode"
13
+ #define WDT_VERSION_STR "1.19.1509200 -fbcode"
14
14
// Tie minor and proto version
15
15
#define WDT_PROTOCOL_VERSION WDT_VERSION_MINOR
16
16
You can’t perform that action at this time.
0 commit comments