mirror of https://github.com/procxx/kepka.git
Fix crash in destructor of Data::CloudFile.
This commit is contained in:
parent
63c6a1db82
commit
f88b97553e
|
@ -16,6 +16,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
namespace Data {
|
||||
|
||||
CloudFile::~CloudFile() {
|
||||
// Destroy loader with still alive CloudFile with already zero '.loader'.
|
||||
// Otherwise in ~FileLoader it tries to clear file.loader and crashes.
|
||||
base::take(loader);
|
||||
}
|
||||
|
||||
void CloudImageView::set(
|
||||
not_null<Main::Session*> session,
|
||||
QImage image) {
|
||||
|
@ -224,7 +230,8 @@ void LoadCloudFile(
|
|||
}
|
||||
// NB! file.loader may be in ~FileLoader() already.
|
||||
if (const auto loader = base::take(file.loader)) {
|
||||
if (file.flags & CloudFile::Flag::Cancelled) {
|
||||
if ((file.flags & CloudFile::Flag::Cancelled)
|
||||
&& !loader->cancelled()) {
|
||||
loader->cancel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ struct CloudFile final {
|
|||
};
|
||||
friend inline constexpr bool is_flag_type(Flag) { return true; };
|
||||
|
||||
~CloudFile();
|
||||
|
||||
ImageLocation location;
|
||||
std::unique_ptr<FileLoader> loader;
|
||||
int byteSize = 0;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 6451ae50741a13b6b8e48835da654e24f34695aa
|
||||
Subproject commit 30d223befe328ff697b3af879ef69c514d21c5f3
|
Loading…
Reference in New Issue