Occasional unreproducible crashes in MessageReceiverMap::dispatchMessage
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / Cocoa / WKWebView.mm
index 3a6bcd7546081b7e669dd0c6c351e075445e1e7f..cdd9c165c0153d81f636245f365b6b61980beb26 100644 (file)
@@ -352,6 +352,9 @@ static int32_t deviceOrientation()
 
 - (void)dealloc
 {
+    if (_remoteObjectRegistry)
+        _page->process().context().removeMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID());
+
     _page->close();
 
     [_remoteObjectRegistry _invalidate];