Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit 263521e

Browse files
committed
bugfix ios 8.11.1 multithreading crash by eagle destroy instance
1 parent 8a6c6fa commit 263521e

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -792,26 +792,7 @@ - (void)destroyInstance:(NSString *)instance
792792
}
793793

794794
WXSDKInstance *sdkInstance = [WXSDKManager instanceForID:instance];
795-
if (sdkInstance.dataRender) {
796-
if (_dataRenderHandler) {
797-
WXPerformBlockOnComponentThread(^{
798-
[_dataRenderHandler destroyDataRenderInstance:instance];
799-
WXPerformBlockOnBridgeThreadForInstance(^{
800-
[self callJSMethod:@"destroyInstance" args:@[instance]];
801-
}, instance);
802-
});
803-
}
804-
else {
805-
WXComponentManager *manager = sdkInstance.componentManager;
806-
if (manager.isValid) {
807-
WXSDKErrCode errorCode = WX_KEY_EXCEPTION_DEGRADE_EAGLE_RENDER_ERROR;
808-
NSError *error = [NSError errorWithDomain:WX_ERROR_DOMAIN code:errorCode userInfo:@{@"message":@"No data render handler found!"}];
809-
WXPerformBlockOnComponentThread(^{
810-
[manager renderFailed:error];
811-
});
812-
}
813-
}
814-
} else {
795+
if (!sdkInstance.wlasmRender) {
815796
[self callJSMethod:@"destroyInstance" args:@[instance]];
816797
}
817798
}

weex_core/Source/core/bridge/platform/core_side_in_platform.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ void CoreSideInPlatform::SetDefaultHeightAndWidthIntoRootDom(
5555
}
5656

5757
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+
}
5862
RenderManager::GetInstance()->ClosePage(instance_id);
5963
}
6064

0 commit comments

Comments
 (0)