Open carbotaniuman opened 4 years ago
Class __WKScriptMessageHandler = objc_allocateClassPair(
objc_getClass("NSObject"), "__WKScriptMessageHandler", 0);
class_addMethod(
__WKScriptMessageHandler,
sel_registerName("userContentController:didReceiveScriptMessage:"),
(IMP)webview_external_invoke, "v@:@@");
objc_registerClassPair(__WKScriptMessageHandler);
These lines are responsible for the segmentation fault when opening multiple windows. objc_allocateClassPair
can return NULL if the class is already registered, and I'm wondering what this code does and whether it works with multiple windows.
Opening for tracking as we just hit this. 90% sure someone has already worked on or fixed this.