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

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: Created 3 years, 8 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 ece683b339239a46d62b9baee10638a9cfe66b43..8774603d81f8bbf76a2acefbf2ebdb5f2240b277 100644
--- a/ios/web_view/internal/cwv_scroll_view.mm
+++ b/ios/web_view/internal/cwv_scroll_view.mm
@@ -66,6 +66,14 @@
_proxy.contentInset = contentInset;
}
+#pragma mark - NSObject
+
+- (void)dealloc {
+ // Explicitly set |proxy| to nil to remove |self| from |proxy|'s observers.
+ // Otherwise |proxy| will keep a dangling pointer to |self| and cause SEGV.
+ self.proxy = nil;
Eugene But (OOO till 7-30) 2017/04/28 07:06:23 _proxy = nil; https://google.github.io/styleguide
Hiroshi Ichikawa 2017/04/28 08:47:41 The goal here is to call [_proxy removeObserver:se
Eugene But (OOO till 7-30) 2017/04/28 10:08:57 Thanks!
+}
+
#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