2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +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

@@ -1555,12 +1555,12 @@ base::binary_guard ReadImageAsync(
not_null<DocumentData*> document,
FnMut<QImage(QImage)> postprocess,
FnMut<void(QImage&&)> done) {
auto [left, right] = base::make_binary_guard();
auto result = base::binary_guard();
crl::async([
bytes = document->data(),
path = document->filepath(),
postprocess = std::move(postprocess),
guard = std::move(left),
guard = result.make_guard(),
callback = std::move(done)
]() mutable {
auto format = QByteArray();
@@ -1584,7 +1584,7 @@ base::binary_guard ReadImageAsync(
callback(std::move(image));
});
});
return std::move(right);
return result;
}
//void HandleUnsupportedMedia(