mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Fix crash in DocumentData destructor.
Keep AuthSession pointer in DocumentData for loader destruction.
This commit is contained in:
@@ -699,7 +699,9 @@ void Session::photoApplyFields(
|
||||
not_null<DocumentData*> Session::document(DocumentId id) {
|
||||
auto i = _documents.find(id);
|
||||
if (i == _documents.cend()) {
|
||||
i = _documents.emplace(id, DocumentData::create(id)).first;
|
||||
i = _documents.emplace(
|
||||
id,
|
||||
std::make_unique<DocumentData>(id, _session)).first;
|
||||
}
|
||||
return i->second.get();
|
||||
}
|
||||
|
Reference in New Issue
Block a user