Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: ios/web_view/shell/shell_view_controller.m

Issue 2847803006: Fix a crash bug on deallocation of CWVWebView caused by CWVScrollView. (Closed)
Patch Set: Rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web_view/internal/cwv_scroll_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
}
« no previous file with comments | « ios/web_view/internal/cwv_scroll_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698