2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Improve base::binary_guard interface.

This commit is contained in:
John Preston
2019-03-27 16:11:38 +04:00
parent efb2972d28
commit d3bf489bea
12 changed files with 38 additions and 54 deletions

View File

@@ -711,13 +711,11 @@ void BackgroundPreviewBox::checkLoadedDocument() {
return;
}
const auto generateCallback = [=](QImage &&image) {
auto [left, right] = base::make_binary_guard();
_generating = std::move(left);
crl::async([
this,
image = std::move(image),
patternBackground = patternBackgroundColor(),
guard = std::move(right)
guard = _generating.make_guard()
]() mutable {
auto scaled = PrepareScaledFromFull(image, patternBackground);
const auto ms = crl::now();