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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user