mirror of https://github.com/procxx/kepka.git
Fix document unloading.
This commit is contained in:
parent
264ab285a7
commit
f2348fc749
|
@ -32,7 +32,6 @@ private:
|
||||||
SingleQueuedInvokation _delayed;
|
SingleQueuedInvokation _delayed;
|
||||||
int64 _usage = 0;
|
int64 _usage = 0;
|
||||||
int64 _limit = 0;
|
int64 _limit = 0;
|
||||||
Fn<void(Type*)> _unload;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -595,9 +595,10 @@ void DocumentData::unload() {
|
||||||
delete replyPreview.get();
|
delete replyPreview.get();
|
||||||
replyPreview = ImagePtr();
|
replyPreview = ImagePtr();
|
||||||
}
|
}
|
||||||
|
if (!_data.isEmpty()) {
|
||||||
ActiveCache().decrement(_data.size());
|
ActiveCache().decrement(_data.size());
|
||||||
_data.clear();
|
_data.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentData::automaticLoad(
|
void DocumentData::automaticLoad(
|
||||||
|
@ -1358,6 +1359,7 @@ DocumentData::~DocumentData() {
|
||||||
if (loading()) {
|
if (loading()) {
|
||||||
destroyLoaderDelayed();
|
destroyLoaderDelayed();
|
||||||
}
|
}
|
||||||
|
unload();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DocumentData::ComposeNameString(
|
QString DocumentData::ComposeNameString(
|
||||||
|
|
|
@ -149,7 +149,9 @@ LocalFileSource::LocalFileSource(
|
||||||
: _path(path)
|
: _path(path)
|
||||||
, _bytes(content)
|
, _bytes(content)
|
||||||
, _format(format)
|
, _format(format)
|
||||||
, _data(std::move(data)) {
|
, _data(std::move(data))
|
||||||
|
, _width(_data.width())
|
||||||
|
, _height(_data.height()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalFileSource::load(
|
void LocalFileSource::load(
|
||||||
|
|
Loading…
Reference in New Issue