2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Don't unload all media on switching between chats.

This commit is contained in:
John Preston
2018-10-23 16:57:43 +04:00
parent 959859f57c
commit 8e7117fa22
21 changed files with 61 additions and 83 deletions

View File

@@ -103,15 +103,16 @@ bool PhotoData::uploading() const {
return (uploadingData != nullptr);
}
void PhotoData::forget() {
thumb->forget();
void PhotoData::unload() {
// Forget thumb only when image cache limit exceeds.
//thumb->unload();
medium->unload();
full->unload();
if (!replyPreview->isNull()) {
// Should be std::unique_ptr<Image>.
delete replyPreview.get();
replyPreview = ImagePtr();
}
medium->forget();
full->forget();
}
ImagePtr PhotoData::makeReplyPreview(Data::FileOrigin origin) {