Memory leak WKWebView iOS 8.4

2k views Asked by At

WKWebview leaks memory on iOS 8.4. It can be detected using Instruments (Leaks). When we check the Stack Trace, it points towards the initialisation of WKWebView.

webView = [[WKWebView alloc] initWithFrame:_displayView.frame];

If we drill down, we can figure out that UIWebSelectionAssistant & _UIKeyboardTextSelectionGestureController are allocated but never released.

Since these are called by WKWebView internally, I don't know how to release them. Although I am using ARC, but still I have written these in dealloc method:

[webView stopLoading];
webView.navigationDelegate = nil;
[webView removeFromSuperview];
webView = nil;

However, still I can't avoid leaks. More details can be found in the screenshot attached. Link to leaks screenshot

Thanks!

0

There are 0 answers