Fix retain cycle caused by ConnectionTypeObserverBridge
There are two uses of ConnectionTypeObserverBridge by Objective-C classes (MetricsMediator and PreloadController) and both of them pass "self" as the observer. Since those classes also keep the ownership of the C++ bridge (via a std::unique_ptr<ConnectionTypeObserverBridge> ivar), this caused a retain cycle because "observer_" was strongly retained. Mark the observer as __weak in order to break the retain cycle. Bug: 1005152 Change-Id: Ief077e6ab97d7f6daa30951a3bed012308bb5369 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1813338 Commit-Queue: Sylvain Defresne <sdefresne@chromium.org> Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org> Auto-Submit: Sylvain Defresne <sdefresne@chromium.org> Reviewed-by:Stepan Khapugin <stkhapugin@chromium.org> Cr-Commit-Position: refs/heads/master@{#697964}
Showing
Please register or sign in to comment