2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Use base::weak_qptr / base::make_weak.

This commit is contained in:
John Preston
2025-07-18 10:07:39 +04:00
parent 321c7120df
commit b754ad5248
189 changed files with 556 additions and 555 deletions

View File

@@ -175,9 +175,9 @@ void EditPriceBox(
field->showError();
return;
}
const auto weak = Ui::MakeWeak(box);
const auto weak = base::make_weak(box);
apply(now);
if (const auto strong = weak.data()) {
if (const auto strong = weak.get()) {
strong->closeBox();
}
};
@@ -597,7 +597,7 @@ void SendFilesBox::enqueueNextPrepare() {
}
auto file = std::move(_list.filesToProcess.front());
_list.filesToProcess.pop_front();
const auto weak = Ui::MakeWeak(this);
const auto weak = base::make_weak(this);
_preparing = true;
const auto sideLimit = PhotoSideLimit(); // Get on main thread.
crl::async([weak, sideLimit, file = std::move(file)]() mutable {
@@ -803,7 +803,7 @@ void SendFilesBox::toggleSpoilers(bool enabled) {
}
void SendFilesBox::changePrice() {
const auto weak = Ui::MakeWeak(this);
const auto weak = base::make_weak(this);
const auto session = &_show->session();
const auto now = _price.current();
_show->show(Box(EditPriceBox, session, now, [=](uint64 price) {