-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build_log.cc: Remove memory leak in Recompact() method.
The erase() call to remove `dead_outputs` was leaking the LogEntry value that the map pointed to. This patch changes the type of `Entries` to store `std::unique_ptr<LogEntry>` values, instead of raw pointers to get rid of the problem, and adjust call sites accordingly. Also use Entries::emplace() instead of Entries::insert() to create the new value in-place when inserting new ones into the map.
- Loading branch information
1 parent
1fdfe32
commit e7ebebc
Showing
2 changed files
with
22 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters