Also which object do you release? And when exactly?
In general the script message handlers should be set once when creating the WebView and released only before releasing the WebView itself. The JavaScript code is running completely independently from the swift code of your App, so it can be tricky to find the correct time to release the message handler and being sure that it is no longer in use by the JavaScript code.
Topic:
Safari & Web
SubTopic:
General
Tags: