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

Side by Side Diff: ash/display/display_color_manager_chromeos.cc

Issue 1430573006: ash: Fix memory leak in DisplayColorManager on error path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/display/display_color_manager_chromeos.h" 5 #include "ash/display/display_color_manager_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 27 matching lines...) Expand all
38 38
39 if (!display_profile) { 39 if (!display_profile) {
40 LOG(WARNING) << "Unable to load ICC file: " << path.value(); 40 LOG(WARNING) << "Unable to load ICC file: " << path.value();
41 return false; 41 return false;
42 } 42 }
43 43
44 size_t vcgt_channel_length = 44 size_t vcgt_channel_length =
45 qcms_profile_get_vcgt_channel_length(display_profile); 45 qcms_profile_get_vcgt_channel_length(display_profile);
46 if (!vcgt_channel_length) { 46 if (!vcgt_channel_length) {
47 LOG(WARNING) << "No vcgt table in ICC file: " << path.value(); 47 LOG(WARNING) << "No vcgt table in ICC file: " << path.value();
48 qcms_profile_release(display_profile);
48 return false; 49 return false;
49 } 50 }
50 51
51 std::vector<uint16_t> vcgt_data; 52 std::vector<uint16_t> vcgt_data;
52 vcgt_data.resize(vcgt_channel_length * 3); 53 vcgt_data.resize(vcgt_channel_length * 3);
53 if (!qcms_profile_get_vcgt_rgb_channels(display_profile, &vcgt_data[0])) { 54 if (!qcms_profile_get_vcgt_rgb_channels(display_profile, &vcgt_data[0])) {
54 LOG(WARNING) << "Unable to get vcgt data"; 55 LOG(WARNING) << "Unable to get vcgt data";
55 qcms_profile_release(display_profile); 56 qcms_profile_release(display_profile);
56 return false; 57 return false;
57 } 58 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 calibration_map_[product_id] = data.release(); 155 calibration_map_[product_id] = data.release();
155 ApplyDisplayColorCalibration(display_id, product_id); 156 ApplyDisplayColorCalibration(display_id, product_id);
156 } 157 }
157 } 158 }
158 159
159 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {} 160 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {}
160 161
161 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {} 162 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {}
162 163
163 } // namespace ash 164 } // namespace ash
OLDNEW
« 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