Skip to content

Commit

Permalink
Merge branch 'main' into feature/update-vue-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
open-hippy authored Sep 22, 2023
2 parents 2b1586c + f6a3f7d commit a976bf7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/vfs/ios/VFSUriLoader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@
//check if convenient loader exists, or forward to cpp loader
if (cur_convenient) {
auto startPoint = footstone::TimePoint::SystemNow();
auto weak_this = weak_from_this();
VFSHandlerCompletionBlock callback = ^(NSData *data, NSURLResponse *response, NSError *error) {
auto endPoint = footstone::TimePoint::SystemNow();
string_view uri(NSStringToU16StringView([[response URL] absoluteString]));
string_view msg([error.localizedDescription UTF8String]?:"");
DoRequestResultCallback(uri, startPoint, endPoint, static_cast<int32_t>(error.code), msg);
auto shared_this = weak_this.lock();
if (shared_this) {
DoRequestResultCallback(uri, startPoint, endPoint, static_cast<int32_t>(error.code), msg);
}
if (completion) {
completion(data, response, error);
}
Expand Down

0 comments on commit a976bf7

Please sign in to comment.