2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Attempt to fix crash in story preloading.

This commit is contained in:
John Preston
2023-07-25 20:50:21 +04:00
parent 35f0f87f73
commit 30334b6c74
5 changed files with 9 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_session.h"
#include "media/streaming/media_streaming_reader.h"
#include "storage/download_manager_mtproto.h"
#include "storage/file_download.h" // kMaxFileInMemory
#include "ui/text/text_utilities.h"
namespace Data {
@@ -574,6 +575,7 @@ void StoryPreload::load() {
}
_task = std::make_unique<LoadTask>(id(), video, [=](QByteArray data) {
if (!data.isEmpty()) {
Assert(data.size() < Storage::kMaxFileInMemory);
_story->owner().cacheBigFile().putIfEmpty(
key,
Storage::Cache::Database::TaggedValue(std::move(data), 0));