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