Optimize image destruction.

No need to call _source->unload(), it leads to saving to PNG.
This commit is contained in:
John Preston 2020-05-20 13:28:18 +04:00
parent a37138aa52
commit 61647275e8
1 changed files with 3 additions and 1 deletions

View File

@ -1011,7 +1011,9 @@ void Image::invalidateSizeCache() const {
Image::~Image() {
if (this != Empty() && this != BlankMedia()) {
unload();
invalidateSizeCache();
ActiveCache().decrement(ComputeUsage(_data));
_data = QImage();
ActiveCache().remove(this);
}
}