mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 18:19:36 +01:00
Downloader: Join threads in CancelAll
This commit is contained in:
1 parent
1a8084cdbc
commit
bd8083fb26
1 file changed
+6
@@ -446,6 +446,9 @@ void Download::Start() {
|
||||
}
|
||||
|
||||
void Download::Join() {
|
||||
if (joined_) {
|
||||
ELOG("Already joined thread!");
|
||||
}
|
||||
thread_.join();
|
||||
joined_ = true;
|
||||
}
|
||||
@@ -585,6 +588,9 @@ void Downloader::CancelAll() {
|
||||
for (size_t i = 0; i < downloads_.size(); i++) {
|
||||
downloads_[i]->Cancel();
|
||||
}
|
||||
for (size_t i = 0; i < downloads_.size(); i++) {
|
||||
downloads_[i]->Join();
|
||||
}
|
||||
downloads_.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user