fix:iOS Runloop cannot exit and other issues
This commit is contained in:
@@ -102,6 +102,9 @@ - (void)reload:(NSString *)script {
|
||||
[self.driver destroyContext:self.contextId];
|
||||
self.rootNode.viewId = nil;
|
||||
[self.rootNode clearSubModel];
|
||||
[self.rootNode.view.subviews forEach:^(__kindof UIView *obj) {
|
||||
[obj removeFromSuperview];
|
||||
}];
|
||||
self.script = script;
|
||||
[self.driver createContext:self.contextId script:script source:self.source];
|
||||
[self init:self.extra];
|
||||
|
@@ -103,6 +103,9 @@ - (instancetype)init {
|
||||
|
||||
- (void)teardown {
|
||||
_destroyed = YES;
|
||||
//To ensure runloop continue.
|
||||
[self ensureRunOnJSThread:^{
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)ensureRunOnJSThread:(dispatch_block_t)block {
|
||||
|
Reference in New Issue
Block a user