From a39ebb776d61a09d7dc670dfab01b502e37d035e Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Tue, 30 Jun 2009 18:12:22 +0000 Subject: Fix potential memleak in AddPagesWithDetails. Not a biggie since this is used only during testing, if the comment is correct. The reason this leaks is due to potential returns before Broadcast is reached. BUG=None TEST=None Review URL: http://codereview.chromium.org/151047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19610 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/history/history_backend.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chrome/browser/history') diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 066a757..691f24a 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -161,7 +161,7 @@ class HistoryBackend::URLQuerier { // When track_unique_ is set, this is updated with every URL seen so far. std::set unique_urls_; - DISALLOW_EVIL_CONSTRUCTORS(URLQuerier); + DISALLOW_COPY_AND_ASSIGN(URLQuerier); }; // HistoryBackend -------------------------------------------------------------- @@ -659,7 +659,7 @@ void HistoryBackend::AddPagesWithDetails(const std::vector& urls) { if (!db_.get()) return; - URLsModifiedDetails* modified = new URLsModifiedDetails; + scoped_ptr modified(new URLsModifiedDetails); for (std::vector::const_iterator i = urls.begin(); i != urls.end(); ++i) { DCHECK(!i->last_visit().is_null()); @@ -732,7 +732,7 @@ void HistoryBackend::AddPagesWithDetails(const std::vector& urls) { // TODO(brettw) bug 1140015: Add an "add page" notification so the history // views can keep in sync. BroadcastNotifications(NotificationType::HISTORY_TYPED_URLS_MODIFIED, - modified); + modified.release()); ScheduleCommit(); } -- cgit v1.1