yeatse / NSURLProtocol-WebKitSupport

Make your WKWebView happy with NSURLProtocol
MIT License
663 stars 126 forks source link

WebKit::LegacyCustomProtocolManagerProxy::stopLoading(unsigned long long) + 20 #13

Closed wangjunhua1 closed 5 years ago

wangjunhua1 commented 5 years ago

Crashed: com.apple.main-thread 0 WebKit 0x192d677a8 WebKit::LegacyCustomProtocolManagerProxy::stopLoading(unsigned long long) + 20 1 CFNetwork 0x183b60538 65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 60 2 CFNetwork 0x183b604dc -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 200 3 CFNetwork 0x183b60650 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 56 4 CFNetwork 0x183a57ed0 invocation function for block in URLConnectionClient_Classic::_delegate_didFinishLoading(void () block_pointer) + 100 5 CFNetwork 0x183a55d88 invocation function for block in URLConnectionClient_Classic::_withDelegateAsync(char const, void (_CFURLConnection, CFURLConnectionClientCurrent_VMax const) block_pointer) + 108 6 libdispatch.dylib 0x182c54a60 _dispatch_client_callout + 16 7 libdispatch.dylib 0x182c5c170 _dispatch_block_invoke_direct$VARIANT$mp + 224 8 CFNetwork 0x183b37e40 RunloopBlockContext::_invoke_block(void const, void) + 36 9 CoreFoundation 0x183228680 CFArrayApplyFunction + 80 10 CFNetwork 0x183b37d00 RunloopBlockContext::perform() + 128 11 CFNetwork 0x183b38ec4 MultiplexerSource::perform() + 312 12 CFNetwork 0x183b38c24 MultiplexerSource::_perform(void) + 60 13 CoreFoundation 0x18330b404 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24 14 CoreFoundation 0x18330ac2c CFRunLoopDoSources0 + 276 15 CoreFoundation 0x18330879c __CFRunLoopRun + 1204 16 CoreFoundation 0x183228da8 CFRunLoopRunSpecific + 552 17 GraphicsServices 0x18520e020 GSEventRunModal + 100 18 UIKit 0x18d248758 UIApplicationMain + 236 19 BluedInternational 0x100c0aa4c main (main.m:13) 20 libdyld.dylib 0x182cb9fc0 start + 4

wangjunhua1 commented 5 years ago

你好我并没有用WKProcessPool 还是有这个crahs 请问如何把WKProcessPool设置成单例呢 ??

wangjunhua1 commented 5 years ago
image

找到了在创建WKWebview的时候的config中设置就可以了 这里写了一个WKProcessPool的分类

.h

import <WebKit/WebKit.h>

@interface WKProcessPool (SharedProcessPool)

@end

.m

import "WKProcessPool+SharedProcessPool.h"

@implementation WKProcessPool (SharedProcessPool)

}

@end

karosLi commented 3 years ago

still crash with same stack