mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Let [Photo|Document]Media outlive message view.
This commit is contained in:
@@ -230,13 +230,9 @@ void PhotoData::collectLocalData(not_null<PhotoData*> local) {
|
||||
}
|
||||
}
|
||||
if (const auto localMedia = local->activeMediaView()) {
|
||||
const auto media = createMediaView();
|
||||
auto media = createMediaView();
|
||||
media->collectLocalData(localMedia.get());
|
||||
|
||||
// Keep DocumentMedia alive for some more time.
|
||||
// NB! This allows DocumentMedia to outlive Main::Session!
|
||||
// In case this is a problem this code should be rewritten.
|
||||
crl::on_main(&session(), [media] {});
|
||||
_owner->keepAlive(std::move(media));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user