Fix memory leak in downloads thumbnail loading.

This commit is contained in:
John Preston 2024-04-02 11:50:58 +04:00
parent 615ad85d26
commit 1da9df690f
1 changed files with 7 additions and 6 deletions

View File

@ -1123,13 +1123,14 @@ rpl::producer<Ui::DownloadBarContent> MakeDownloadBarContent() {
state->thumbnail = Images::Prepare(embed->original(), 0, {
.options = Images::Option::Blur,
});
} else if (!state->downloadTaskLifetime) {
state->document->session().downloaderTaskFinished(
) | rpl::filter([=] {
return self(self);
}) | rpl::start_with_next(
state->push,
state->downloadTaskLifetime);
}
state->document->session().downloaderTaskFinished(
) | rpl::filter([=] {
return self(self);
}) | rpl::start_with_next(
state->push,
state->downloadTaskLifetime);
return !state->thumbnail.isNull();
};
const auto resolveThumbnail = [=] {