fix(ios): use smart pointer instead of non-smart pointer

This commit is contained in:
luomy
2022-07-25 13:09:01 +08:00
committed by zoomchan-cxj
parent 0987946b2e
commit d648eda41f
+2 -2
View File
@@ -716,7 +716,7 @@ static NSError *executeApplicationScript(NSData *script, NSURL *sourceURL, Hippy
}
- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block {
Engine *engine = [[HippyJSEnginesMapper defaultInstance] JSEngineForKey:self.executorkey].get();
auto engine = [[HippyJSEnginesMapper defaultInstance] JSEngineForKey:self.executorkey];
if (engine) {
if (engine->GetJSRunner()->IsJsThread() == false) {
std::shared_ptr<JavaScriptTask> task = std::make_shared<JavaScriptTask>();
@@ -729,7 +729,7 @@ static NSError *executeApplicationScript(NSData *script, NSURL *sourceURL, Hippy
}
- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block {
Engine *engine = [[HippyJSEnginesMapper defaultInstance] JSEngineForKey:self.executorkey].get();
auto engine = [[HippyJSEnginesMapper defaultInstance] JSEngineForKey:self.executorkey];
if (engine) {
std::shared_ptr<JavaScriptTask> task = std::make_shared<JavaScriptTask>();
task->callback = block;