diff options
author | dewittj <dewittj@chromium.org> | 2016-03-25 14:25:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-25 21:28:17 +0000 |
commit | baab43a9a77d88943fec2566c8ed3ae2c621afe5 (patch) | |
tree | 11654825fe984c7d2772db2d6d472dd70c90fd4c | |
parent | 39a22dc8028987efa3ca24135922841d2d2d387c (diff) | |
download | chromium_src-baab43a9a77d88943fec2566c8ed3ae2c621afe5.zip chromium_src-baab43a9a77d88943fec2566c8ed3ae2c621afe5.tar.gz chromium_src-baab43a9a77d88943fec2566c8ed3ae2c621afe5.tar.bz2 |
Make ChromeActivity destroy its BookmarkModel in all cases when adding a bookmark..
One branch of control flow fails to destroy it, leaking native memory.
BUG=NONE
Review URL: https://codereview.chromium.org/1831183002
Cr-Commit-Position: refs/heads/master@{#383363}
-rw-r--r-- | chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 12a2f8d..39e439b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java @@ -1054,8 +1054,12 @@ public abstract class ChromeActivity extends AsyncInitializationActivity public void run() { // Gives up the bookmarking if the tab is being destroyed. if (!tabToBookmark.isClosing() && tabToBookmark.isInitialized()) { + // The BookmarkModel will be destroyed by BookmarkUtils#addOrEditBookmark() when + // done. BookmarkUtils.addOrEditBookmark(bookmarkId, bookmarkModel, tabToBookmark, getSnackbarManager(), ChromeActivity.this); + } else { + bookmarkModel.destroy(); } } }); |