Index: ios/web_view/shell/shell_view_controller.m |
diff --git a/ios/web_view/shell/shell_view_controller.m b/ios/web_view/shell/shell_view_controller.m |
index c7b1b2a059774c8636317fa655ca9ca23b22540f..da1433f275a0b6cefad0bb564657951b3f99f2e4 100644 |
--- a/ios/web_view/shell/shell_view_controller.m |
+++ b/ios/web_view/shell/shell_view_controller.m |
@@ -203,6 +203,17 @@ NSString* const kWebViewShellJavaScriptDialogTextFieldAccessibiltyIdentifier = |
[_webView reload]; |
}]]; |
+ // Removes the web view from the view hierarchy and deallocates it. For |
+ // testing deallocation behavior, because there have been multiple crash bugs |
+ // on deallocation of CWVWebView. |
+ [alertController |
+ addAction:[UIAlertAction actionWithTitle:@"Deallocate web view" |
+ style:UIAlertActionStyleDefault |
+ handler:^(UIAlertAction* action) { |
+ [_webView removeFromSuperview]; |
+ _webView = nil; |
+ }]]; |
+ |
[self presentViewController:alertController animated:YES completion:nil]; |
} |