Fix document unloading.

This commit is contained in:
John Preston
2018-10-30 10:17:34 +04:00
parent 264ab285a7
commit f2348fc749
3 changed files with 8 additions and 5 deletions
+5 -3
View File
@@ -595,9 +595,10 @@ void DocumentData::unload() {
delete replyPreview.get();
replyPreview = ImagePtr();
}
ActiveCache().decrement(_data.size());
_data.clear();
if (!_data.isEmpty()) {
ActiveCache().decrement(_data.size());
_data.clear();
}
}
void DocumentData::automaticLoad(
@@ -1358,6 +1359,7 @@ DocumentData::~DocumentData() {
if (loading()) {
destroyLoaderDelayed();
}
unload();
}
QString DocumentData::ComposeNameString(