Skip to content

Commit fc8f011

Browse files
authored
Merge pull request marcuswestin#208 from yiplee/master
Break retain cycle for WKWebViewJavascriptBridge
2 parents bc3da46 + 8c7d3bd commit fc8f011

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

WebViewJavascriptBridge/WKWebViewJavascriptBridge.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#if defined(supportsWKWebKit)
1212

1313
@implementation WKWebViewJavascriptBridge {
14-
WKWebView* _webView;
15-
id<WKNavigationDelegate> _webViewDelegate;
14+
__weak WKWebView* _webView;
15+
__weak id<WKNavigationDelegate> _webViewDelegate;
1616
long _uniqueId;
1717
WebViewJavascriptBridgeBase *_base;
1818
}

WebViewJavascriptBridge/WebViewJavascriptBridgeBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ typedef NSDictionary WVJBMessage;
2222
@interface WebViewJavascriptBridgeBase : NSObject
2323

2424

25-
@property (assign) id <WebViewJavascriptBridgeBaseDelegate> delegate;
25+
@property (weak, nonatomic) id <WebViewJavascriptBridgeBaseDelegate> delegate;
2626
@property (strong, nonatomic) NSMutableArray* startupMessageQueue;
2727
@property (strong, nonatomic) NSMutableDictionary* responseCallbacks;
2828
@property (strong, nonatomic) NSMutableDictionary* messageHandlers;

WebViewJavascriptBridge/WebViewJavascriptBridgeBase.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#import "WebViewJavascriptBridge_JS.h"
1111

1212
@implementation WebViewJavascriptBridgeBase {
13-
id _webViewDelegate;
13+
__weak id _webViewDelegate;
1414
long _uniqueId;
1515
}
1616

0 commit comments

Comments
 (0)