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

Commit 181bca5

Browse files
wqyfavorjianhan-he
authored andcommitted
[iOS] Fix devtool unloading bridge manager. (#2520)
1 parent 6cd5788 commit 181bca5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ios/sdk/WeexSDK/Sources/Manager/WXSDKManager.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ - (instancetype)init
5454

5555
+ (WXBridgeManager *)bridgeMgr
5656
{
57-
return [self sharedInstance].bridgeMgr;
57+
WXBridgeManager* result = [self sharedInstance].bridgeMgr;
58+
if (result == nil) {
59+
// devtool may invoke "unload" and set bridgeMgr to nil
60+
result = [[WXBridgeManager alloc] init];
61+
[self sharedInstance].bridgeMgr = result;
62+
}
63+
return result;
5864
}
5965

6066
+ (id)instanceForID:(NSString *)identifier

0 commit comments

Comments
 (0)