marcuswestin / WebViewJavascriptBridge

An iOS/OSX bridge for sending messages between Obj-C and JavaScript in UIWebViews/WebViews
http://marcuswest.in
MIT License
14.29k stars 2.98k forks source link

viewController dont release when I use _bridge = WKWebViewJavascriptBridge #348

Open 396514268 opened 6 years ago

396514268 commented 6 years ago

_bridge = [WKWebViewJavascriptBridge bridgeForWebView:_webView];

when I note this code ,view should go dealloc function

but when I push _bridge=nil in viewDidDisappear

it worked

why?

codingiran commented 6 years ago

I also found it, when i use FBRetainCycleDetector to find the Retain Cycle:
"-> _jsBridge -> WKWebViewJavascriptBridge ", "-> _base -> WebViewJavascriptBridgeBase ", "-> _messageHandlers -> NSDictionaryM ", "-> NSMallocBlock__ "

cavanlee commented 6 years ago

It has a memory leak,i test this, but i have no idea now.