2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix memory clearing from photos/documents.

This commit is contained in:
John Preston
2018-04-07 11:01:32 +04:00
parent 9895b45293
commit e5b2e0a6b5
6 changed files with 42 additions and 1 deletions

View File

@@ -2880,6 +2880,10 @@ TaskId startImageLoad(const StorageKey &location, mtpFileLoader *loader) {
std::make_unique<ImageLoadTask>(j->first, location, loader));
}
bool willImageLoad(const StorageKey &location) {
return _imagesMap.constFind(location) != _imagesMap.cend();
}
int32 hasImages() {
return _imagesMap.size();
}
@@ -3024,6 +3028,10 @@ bool copyAudio(const StorageKey &oldLocation, const StorageKey &newLocation) {
return true;
}
bool willAudioLoad(const StorageKey &location) {
return _audiosMap.constFind(location) != _audiosMap.cend();
}
int32 hasAudios() {
return _audiosMap.size();
}
@@ -3130,6 +3138,10 @@ TaskId startWebFileLoad(const QString &url, webFileLoader *loader) {
std::make_unique<WebFileLoadTask>(j->first, url, loader));
}
bool willWebFileLoad(const QString &url) {
return _webFilesMap.constFind(url) != _webFilesMap.cend();
}
int32 hasWebFiles() {
return _webFilesMap.size();
}