feat:fix iOS memory leak in debugging
This commit is contained in:
@@ -101,6 +101,7 @@ - (void)build:(CGSize)size {
|
||||
- (void)reload:(NSString *)script {
|
||||
[self.driver destroyContext:self.contextId];
|
||||
self.rootNode.viewId = nil;
|
||||
[self.rootNode clearSubModel];
|
||||
self.script = script;
|
||||
[self.driver createContext:self.contextId script:script source:self.source];
|
||||
[self init:self.extra];
|
||||
|
@@ -195,4 +195,8 @@ - (void)ensureSyncInMainQueue:(dispatch_block_t)block {
|
||||
dispatch_async(dispatch_get_main_queue(), block);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.jsExecutor teardown];
|
||||
}
|
||||
@end
|
||||
|
@@ -48,6 +48,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)ensureRunOnJSThread:(dispatch_block_t)block;
|
||||
|
||||
- (void)initJSEngine;
|
||||
|
||||
- (void)teardown;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -101,9 +101,9 @@ - (instancetype)init {
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
- (void)teardown {
|
||||
_destroyed = YES;
|
||||
};
|
||||
}
|
||||
|
||||
- (void)ensureRunOnJSThread:(dispatch_block_t)block {
|
||||
if (NSThread.currentThread == _jsThread) {
|
||||
|
@@ -181,4 +181,10 @@ - (void)requestLayout {
|
||||
[node requestLayout];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)clearSubModel {
|
||||
[super clearSubModel];
|
||||
self.childNodes = @[];
|
||||
self.childViewIds = @[];
|
||||
}
|
||||
@end
|
||||
|
Reference in New Issue
Block a user