diff --git a/doric-android/doric/src/main/java/pub/doric/DoricContext.java b/doric-android/doric/src/main/java/pub/doric/DoricContext.java index 33a0e1c7..cd647fad 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricContext.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricContext.java @@ -199,6 +199,7 @@ public class DoricContext { } public void reload(String script) { + getDriver().destroyContext(getContextId()); for (DoricJavaPlugin javaPlugin : mPluginMap.values()) { javaPlugin.onTearDown(); } diff --git a/doric-iOS/Pod/Classes/DoricContext.m b/doric-iOS/Pod/Classes/DoricContext.m index 04914b2a..0f3ebb50 100644 --- a/doric-iOS/Pod/Classes/DoricContext.m +++ b/doric-iOS/Pod/Classes/DoricContext.m @@ -97,6 +97,7 @@ - (void)build:(CGSize)size { } - (void)reload:(NSString *)script { + [self.driver destroyContext:self.contextId]; self.rootNode.viewId = nil; self.script = script; [self.driver createContext:self.contextId script:script source:self.source];