2
0
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:
John Preston
2018-01-27 12:21:57 +03:00
parent 63c1212ef1
commit a858ab5d0b
8 changed files with 187 additions and 180 deletions

View File

@@ -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();
}