mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-28 21:48:13 +08:00
fix(ios): use smart pointer instead of non-smart pointer
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user