Commit 1c06c3fa authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

[Media Engagement] Fix memory leak

There is a memory leak in the contents observer.

BUG=885394

Change-Id: Iea5044f3c739c4c42962e5aea5c5dfda6d5790f4
Reviewed-on: https://chromium-review.googlesource.com/c/1335784Reviewed-by: default avatarCJ DiMeglio <lethalantidote@chromium.org>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610197}
parent 58720c1c
......@@ -428,7 +428,7 @@ void MediaEngagementContentsObserver::MaybeInsertRemoveSignificantPlayer(
if (state.muted == false && state.playing == true &&
state.has_audio == true &&
audible_players_.find(id) == audible_players_.end()) {
audible_players_[id] = std::make_pair(false, nullptr);
audible_players_.emplace(id, std::make_pair(false, nullptr));
}
bool is_currently_significant =
......
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