This repository was archived by the owner on Jun 3, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
weex_core/Source/core/bridge/platform Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -1651,6 +1651,7 @@ + (double)getLayoutTime:(NSString*)pageId {
1651
1651
+ (void )closePage : (NSString *)pageId
1652
1652
{
1653
1653
if (platformBridge) {
1654
+ platformBridge->core_side ()->DestroyInstance ([pageId UTF8String ]);
1654
1655
platformBridge->core_side ()->OnInstanceClose ([pageId UTF8String ] ?: " " );
1655
1656
}
1656
1657
}
Original file line number Diff line number Diff line change @@ -795,7 +795,11 @@ - (void)destroyInstance
795
795
796
796
[WXPrerenderManager removePrerenderTaskforUrl: [self .scriptURL absoluteString ]];
797
797
[WXPrerenderManager destroyTask: self .instanceId];
798
- [[WXSDKManager bridgeMgr ] destroyInstance: self .instanceId];
798
+ BOOL dataRender = self.dataRender ;
799
+ BOOL wlasmRender = self.wlasmRender ;
800
+ if (!dataRender) {
801
+ [[WXSDKManager bridgeMgr ] destroyInstance: self .instanceId];
802
+ }
799
803
800
804
WXComponentManager* componentManager = self.componentManager ;
801
805
NSString * instanceId = self.instanceId ;
@@ -813,6 +817,10 @@ - (void)destroyInstance
813
817
// Destroy weexcore c++ page and objects.
814
818
[WXCoreBridge closePage: instanceId];
815
819
820
+ if (dataRender && !wlasmRender) {
821
+ [[WXSDKManager bridgeMgr ] destroyInstance: instanceId];
822
+ }
823
+
816
824
// Destroy heron render target page
817
825
if ([WXCustomPageBridge isCustomPage: instanceId]) {
818
826
[[WXCustomPageBridge sharedInstance ] removePage: instanceId];
Original file line number Diff line number Diff line change @@ -55,10 +55,6 @@ void CoreSideInPlatform::SetDefaultHeightAndWidthIntoRootDom(
55
55
}
56
56
57
57
void CoreSideInPlatform::OnInstanceClose (const std::string &instance_id) {
58
- auto handler = EagleBridge::GetInstance ()->data_render_handler ();
59
- if (handler) {
60
- handler->DestroyInstance (instance_id.c_str ());
61
- }
62
58
RenderManager::GetInstance ()->ClosePage (instance_id);
63
59
}
64
60
@@ -604,13 +600,17 @@ std::unique_ptr<WeexJSResult> CoreSideInPlatform::ExecJSOnInstance(const char *i
604
600
605
601
int CoreSideInPlatform::DestroyInstance (const char *instanceId) {
606
602
auto handler = EagleBridge::GetInstance ()->data_render_handler ();
607
- if (handler!= nullptr ){
603
+ if (handler != nullptr ) {
608
604
handler->DestroyInstance (instanceId);
609
605
}
610
606
if (JsonRenderManager::GetInstance ()->ClosePage (instanceId)) {
611
607
return true ;
612
608
}
613
- return WeexCoreManager::Instance ()->script_bridge ()->script_side ()->DestroyInstance (instanceId);
609
+ auto script_side = WeexCoreManager::Instance ()->script_bridge ()->script_side ();
610
+ if (script_side) {
611
+ return script_side->DestroyInstance (instanceId);
612
+ }
613
+ return true ;
614
614
}
615
615
616
616
int CoreSideInPlatform::UpdateGlobalConfig (const char *config) {
You can’t perform that action at this time.
0 commit comments