mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +02:00
Optimize image destruction.
No need to call _source->unload(), it leads to saving to PNG.
This commit is contained in:
parent
a37138aa52
commit
61647275e8
1 changed files with 3 additions and 1 deletions
|
@ -1011,7 +1011,9 @@ void Image::invalidateSizeCache() const {
|
||||||
|
|
||||||
Image::~Image() {
|
Image::~Image() {
|
||||||
if (this != Empty() && this != BlankMedia()) {
|
if (this != Empty() && this != BlankMedia()) {
|
||||||
unload();
|
invalidateSizeCache();
|
||||||
|
ActiveCache().decrement(ComputeUsage(_data));
|
||||||
|
_data = QImage();
|
||||||
ActiveCache().remove(this);
|
ActiveCache().remove(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue