summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/renderer_main.cc
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-09 15:35:47 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-09 15:35:47 +0000
commit7c32108b22446be27129324ce41d32e9c909e379 (patch)
tree2b18444c829ae9155036ef3c55ab1fb645b9621e /chrome/renderer/renderer_main.cc
parent54131d25aa7e887f89ba25851b983150cd1384a8 (diff)
downloadchromium_src-7c32108b22446be27129324ce41d32e9c909e379.zip
chromium_src-7c32108b22446be27129324ce41d32e9c909e379.tar.gz
chromium_src-7c32108b22446be27129324ce41d32e9c909e379.tar.bz2
Add Recycle() method to scoped autorelease pool to allow cleaning out any junk
created at startup before the main runloop. Correct quit on Mac to let the BrowserProcess shut down the event loop when its refcount goes to zero after cleaning up all browser windows. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/renderer_main.cc')
-rw-r--r--chrome/renderer/renderer_main.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc
index ff13fdb..561a9ef 100644
--- a/chrome/renderer/renderer_main.cc
+++ b/chrome/renderer/renderer_main.cc
@@ -6,6 +6,7 @@
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
+#include "base/scoped_nsautorelease_pool.h"
#include "base/string_util.h"
#include "base/system_monitor.h"
#include "chrome/common/chrome_constants.h"
@@ -56,6 +57,7 @@ static void HandleRendererErrorTestParameters(const CommandLine& command_line) {
// mainline routine for running as the Rendererer process
int RendererMain(const MainFunctionParams& parameters) {
const CommandLine& parsed_command_line = parameters.command_line_;
+ base::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_;
RendererMainPlatformDelegate platform(parameters);
StatsScope<StatsCounterTimer>
@@ -91,6 +93,7 @@ int RendererMain(const MainFunctionParams& parameters) {
if (run_loop) {
// Load the accelerator table from the browser executable and tell the
// message loop to use it when translating messages.
+ if (pool) pool->Recycle();
MessageLoop::current()->Run();
}