3

After having converted my project to swift 3 I get the following error when I post a simple message (log) from JS though the userContentController

contentController.add(self, name: "log")

func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage){
    return
}

window.webkit.messageHandlers.log.postMessage(args)

Sample(961,0x1b8f6dc40) malloc: *** error for object 0x1740b38c0:
pointer being freed was not allocated

I run my application on an iPhone 6/10.2. No error with the simulator.

I was able to reproduce this error with another application I downloaded from the web

It seems that's a bug of the framework (JSContext deallocation).

Any idea ?

Bug reported to Apple (29898945)

See below the stack (image).

Thank you so much

enter image description here

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
  • 3
    To avoid this issue I've to uncheck "Automatically Show Web Inspector for JSContexts" in safari or to close Safari when I run my application – Frédéric Dal Bo Jan 06 '17 at 16:48
  • See related post for same issue http://stackoverflow.com/questions/#39927338/wkwebview-error-calling-any-javascript-in-ios-10-while-debugging – Frédéric Dal Bo Jan 06 '17 at 16:56

0 Answers0