mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Fix crash in session destruction.
Also use rpl::event_stream for downloaderTaskFinished.
This commit is contained in:
@@ -26,7 +26,7 @@ void CloudImageView::set(
|
||||
not_null<Main::Session*> session,
|
||||
QImage image) {
|
||||
_image.emplace(std::move(image));
|
||||
session->downloaderTaskFinished().notify();
|
||||
session->notifyDownloaderTaskFinished();
|
||||
}
|
||||
|
||||
CloudImage::CloudImage() = default;
|
||||
|
@@ -222,8 +222,7 @@ void CloudThemes::loadDocumentAndInvoke(
|
||||
return;
|
||||
}
|
||||
if (!alreadyWaiting) {
|
||||
base::ObservableViewer(
|
||||
_session->downloaderTaskFinished()
|
||||
_session->downloaderTaskFinished(
|
||||
) | rpl::filter([=, &value] {
|
||||
return value.documentMedia->loaded();
|
||||
}) | rpl::start_with_next([=, &value] {
|
||||
|
@@ -168,7 +168,7 @@ void DocumentMedia::setGoodThumbnail(QImage thumbnail) {
|
||||
return;
|
||||
}
|
||||
_goodThumbnail = std::make_unique<Image>(std::move(thumbnail));
|
||||
_owner->session().downloaderTaskFinished().notify();
|
||||
_owner->session().notifyDownloaderTaskFinished();
|
||||
}
|
||||
|
||||
Image *DocumentMedia::thumbnailInline() const {
|
||||
@@ -206,7 +206,7 @@ QSize DocumentMedia::thumbnailSize() const {
|
||||
|
||||
void DocumentMedia::setThumbnail(QImage thumbnail) {
|
||||
_thumbnail = std::make_unique<Image>(std::move(thumbnail));
|
||||
_owner->session().downloaderTaskFinished().notify();
|
||||
_owner->session().notifyDownloaderTaskFinished();
|
||||
}
|
||||
|
||||
QByteArray DocumentMedia::videoThumbnailContent() const {
|
||||
|
@@ -82,7 +82,7 @@ void PhotoMedia::set(PhotoSize size, QImage image) {
|
||||
Qt::SmoothTransformation);
|
||||
}
|
||||
_images[index] = std::make_unique<Image>(std::move(image));
|
||||
_owner->session().downloaderTaskFinished().notify();
|
||||
_owner->session().notifyDownloaderTaskFinished();
|
||||
}
|
||||
|
||||
bool PhotoMedia::loaded() const {
|
||||
|
@@ -34,7 +34,7 @@ void StickersSetThumbnailView::set(
|
||||
} else {
|
||||
_image = std::make_unique<Image>(std::move(image));
|
||||
}
|
||||
session->downloaderTaskFinished().notify();
|
||||
session->notifyDownloaderTaskFinished();
|
||||
}
|
||||
|
||||
Image *StickersSetThumbnailView::image() const {
|
||||
|
Reference in New Issue
Block a user