Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different handling of Download lifetimes. #13067

Merged
merged 2 commits into from
Jun 28, 2020
Merged

Conversation

hrydgard
Copy link
Owner

Might help an issue from #13057 (1.10 crash mysteries).

Very lightly tested but appears to work.

@hrydgard hrydgard added this to the v1.10.1 milestone Jun 28, 2020
@@ -562,6 +565,7 @@ void Downloader::Update() {
for (size_t i = 0; i < downloads_.size(); i++) {
if (downloads_[i]->Progress() == 1.0f || downloads_[i]->Failed()) {
downloads_[i]->RunCallback();
downloads_[i]->Join();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to do this in CancelAll() too, or we'll crash now. For perf, I'd say a separate loop joining them after they are all marked canceled (though, not sure we will often have multiple downloads.)

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I'll fix it up.

@hrydgard
Copy link
Owner Author

There, that should take care of it.

We don't really do multiple downloads a lot, but good to be ready.

@unknownbrackets unknownbrackets merged commit 807fcf8 into master Jun 28, 2020
@hrydgard hrydgard deleted the download-rework branch October 4, 2020 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants