summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-23 16:06:14 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-23 16:06:14 +0000
commitb797e15e8a5ad8e574013b7624d4c3513a2f764d (patch)
treea6c80381ed061d1aacf5135c3018c3b46aae4d2e /chrome
parent86dc25f56d7b1b379faedfc215f22f0fba3d5db6 (diff)
downloadchromium_src-b797e15e8a5ad8e574013b7624d4c3513a2f764d.zip
chromium_src-b797e15e8a5ad8e574013b7624d4c3513a2f764d.tar.gz
chromium_src-b797e15e8a5ad8e574013b7624d4c3513a2f764d.tar.bz2
Fixes leak of shutdown event in BrowserProcess.
BUG=none TEST=none Review URL: http://codereview.chromium.org/18534 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_process_impl.cc4
-rw-r--r--chrome/browser/browser_process_impl.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 3fa75d5..550254c 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -128,7 +128,7 @@ BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line)
memory_model_ = MEDIUM_MEMORY_MODEL;
}
- shutdown_event_ = new base::WaitableEvent(true, false);
+ shutdown_event_.reset(new base::WaitableEvent(true, false));
}
BrowserProcessImpl::~BrowserProcessImpl() {
@@ -207,7 +207,7 @@ static void PostQuit(MessageLoop* message_loop) {
void BrowserProcessImpl::EndSession() {
// Notify we are going away.
- ::SetEvent(shutdown_event_);
+ ::SetEvent(shutdown_event_->handle());
// Mark all the profiles as clean.
ProfileManager* pm = profile_manager();
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h
index bcbb862..8d059b3 100644
--- a/chrome/browser/browser_process_impl.h
+++ b/chrome/browser/browser_process_impl.h
@@ -167,7 +167,9 @@ class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe {
return memory_model_;
}
- virtual base::WaitableEvent* shutdown_event() { return shutdown_event_; }
+ virtual base::WaitableEvent* shutdown_event() {
+ return shutdown_event_.get();
+ }
private:
void CreateResourceDispatcherHost();
@@ -242,7 +244,7 @@ class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe {
bool using_new_frames_;
// An event that notifies when we are shutting-down.
- base::WaitableEvent* shutdown_event_;
+ scoped_ptr<base::WaitableEvent> shutdown_event_;
DISALLOW_EVIL_CONSTRUCTORS(BrowserProcessImpl);
};