mirror of https://github.com/procxx/kepka.git
Fix crash in still downloaded ~DocumentData.
This commit is contained in:
parent
1e9c79ca85
commit
ff6365ec72
|
@ -749,6 +749,7 @@ void DocumentData::automaticLoadSettingsChanged() {
|
|||
}
|
||||
|
||||
void DocumentData::finishLoad() {
|
||||
// NB! _loader may be in ~FileLoader() already.
|
||||
const auto guard = gsl::finally([&] {
|
||||
destroyLoader();
|
||||
});
|
||||
|
|
|
@ -43,7 +43,11 @@ FileLoader::FileLoader(
|
|||
Expects(!_filename.isEmpty() || (_size <= Storage::kMaxFileInMemory));
|
||||
}
|
||||
|
||||
FileLoader::~FileLoader() = default;
|
||||
FileLoader::~FileLoader() {
|
||||
if (!_finished) {
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
|
||||
Main::Session &FileLoader::session() const {
|
||||
return *_session;
|
||||
|
|
Loading…
Reference in New Issue