mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Fix crash in session destruction.
Also use rpl::event_stream for downloaderTaskFinished.
This commit is contained in:
@@ -291,7 +291,8 @@ EditCaptionBox::EditCaptionBox(
|
||||
Assert(_thumbnailImageLoaded || _refreshThumbnail);
|
||||
|
||||
if (!_thumbnailImageLoaded) {
|
||||
subscribe(_controller->session().downloaderTaskFinished(), [=] {
|
||||
_controller->session().downloaderTaskFinished(
|
||||
) | rpl::start_with_next([=] {
|
||||
if (_thumbnailImageLoaded
|
||||
|| (_photoMedia && !_photoMedia->image(PhotoSize::Large))
|
||||
|| (_documentMedia && !_documentMedia->thumbnail())) {
|
||||
@@ -299,7 +300,7 @@ EditCaptionBox::EditCaptionBox(
|
||||
}
|
||||
_refreshThumbnail();
|
||||
update();
|
||||
});
|
||||
}, lifetime());
|
||||
}
|
||||
_field.create(
|
||||
this,
|
||||
|
Reference in New Issue
Block a user