feat:when reload doriccontext,release the js resource
This commit is contained in:
parent
12fcf71526
commit
57b5c7596b
@ -199,6 +199,7 @@ public class DoricContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void reload(String script) {
|
public void reload(String script) {
|
||||||
|
getDriver().destroyContext(getContextId());
|
||||||
for (DoricJavaPlugin javaPlugin : mPluginMap.values()) {
|
for (DoricJavaPlugin javaPlugin : mPluginMap.values()) {
|
||||||
javaPlugin.onTearDown();
|
javaPlugin.onTearDown();
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,7 @@ - (void)build:(CGSize)size {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)reload:(NSString *)script {
|
- (void)reload:(NSString *)script {
|
||||||
|
[self.driver destroyContext:self.contextId];
|
||||||
self.rootNode.viewId = nil;
|
self.rootNode.viewId = nil;
|
||||||
self.script = script;
|
self.script = script;
|
||||||
[self.driver createContext:self.contextId script:script source:self.source];
|
[self.driver createContext:self.contextId script:script source:self.source];
|
||||||
|
Reference in New Issue
Block a user