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

Unified Diff: chrome/browser/policy/asynchronous_policy_loader.cc

Issue 5748002: Fix memory leaks in AsynchronousPolicyProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review feedback Created 10 years 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 | « chrome/browser/policy/asynchronous_policy_loader.h ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/asynchronous_policy_loader.cc
diff --git a/chrome/browser/policy/asynchronous_policy_loader.cc b/chrome/browser/policy/asynchronous_policy_loader.cc
index ea27bb767dfd4e5bbd9021c310d7b858a1305ae7..f244eda5c00adb8f33b8c0bac0e5e886a6b4cf4d 100644
--- a/chrome/browser/policy/asynchronous_policy_loader.cc
+++ b/chrome/browser/policy/asynchronous_policy_loader.cc
@@ -61,9 +61,10 @@ void AsynchronousPolicyLoader::PostUpdatePolicyTask(
}
void AsynchronousPolicyLoader::UpdatePolicy(DictionaryValue* new_policy_raw) {
+ scoped_ptr<DictionaryValue> new_policy(new_policy_raw);
DCHECK(policy_.get());
- if (!policy_->Equals(new_policy_raw)) {
- policy_.reset(new_policy_raw);
+ if (!policy_->Equals(new_policy.get())) {
+ policy_.reset(new_policy.release());
// TODO(danno): Change the notification between the provider and the
// PrefStore into a notification mechanism, removing the need for the
// WeakPtr for the provider.
« no previous file with comments | « chrome/browser/policy/asynchronous_policy_loader.h ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698