Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2140)

Unified Diff: ash/content/display/display_color_manager_chromeos.cc

Issue 1127213007: ash: display: Safely delete color calibration data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/content/display/display_color_manager_chromeos.cc
diff --git a/ash/content/display/display_color_manager_chromeos.cc b/ash/content/display/display_color_manager_chromeos.cc
index 9692e6243b80629790f3650b239b0fcdb64c65bd..1f177fde1444412b3da3b380da16b8405228f763 100644
--- a/ash/content/display/display_color_manager_chromeos.cc
+++ b/ash/content/display/display_color_manager_chromeos.cc
@@ -11,6 +11,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/path_service.h"
+#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "chromeos/chromeos_paths.h"
#include "chromeos/chromeos_switches.h"
@@ -91,11 +92,7 @@ DisplayColorManager::DisplayColorManager(ui::DisplayConfigurator* configurator)
DisplayColorManager::~DisplayColorManager() {
configurator_->RemoveObserver(this);
-
- for (auto it : calibration_map_) {
- delete it.second;
- calibration_map_.erase(it.first);
- }
+ STLDeleteValues(&calibration_map_);
}
void DisplayColorManager::OnDisplayModeChanged(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698