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

Unified Diff: ios/web_view/internal/cwv_scroll_view.mm

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 | « no previous file | ios/web_view/shell/shell_view_controller.m » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/internal/cwv_scroll_view.mm
diff --git a/ios/web_view/internal/cwv_scroll_view.mm b/ios/web_view/internal/cwv_scroll_view.mm
index ceec039a0322fbd92eb14e51b3afb10ae983aeaa..53dc5d8cb22857e8edd9ced179bc94dcc5e9da57 100644
--- a/ios/web_view/internal/cwv_scroll_view.mm
+++ b/ios/web_view/internal/cwv_scroll_view.mm
@@ -62,6 +62,14 @@
[_proxy addGestureRecognizer:gestureRecognizer];
}
+#pragma mark - NSObject
+
+- (void)dealloc {
+ // Removes |self| from |_proxy|'s observers. Otherwise |_proxy| will keep a
+ // dangling pointer to |self| and cause SEGV later.
+ [_proxy removeObserver:self];
+}
+
#pragma mark - CRWWebViewScrollViewObserver
- (void)webViewScrollViewWillBeginDragging:
« no previous file with comments | « no previous file | ios/web_view/shell/shell_view_controller.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698