Commit a3e0f57e authored by Patrick Noland's avatar Patrick Noland Committed by Commit Bot

Destroy BookmarkBridge in ChromeActivity#onDestroy

Failing to do this leaves behind a native observer of bookmark events
that can hold onto a profile that subsequently gets deleted. When the
observer is triggered, accessing the deleted profile causes a crash.

Bug: 1092391
Change-Id: I7864d2c63ae4952aee64cb28574c0404cb868dd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2236092Reviewed-by: default avatarFilip Gorski <fgorski@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Patrick Noland <pnoland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776489}
parent b6149cb5
......@@ -1255,6 +1255,12 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
if (selector != null) selector.destroy();
}
if (mBookmarkBridgeSupplier != null) {
BookmarkBridge bookmarkBridge = mBookmarkBridgeSupplier.get();
if (bookmarkBridge != null) bookmarkBridge.destroy();
mBookmarkBridgeSupplier = null;
}
mActivityTabProvider.destroy();
mComponent = null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment