diff options
author | hartmanng@chromium.org <hartmanng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 04:57:03 +0000 |
---|---|---|
committer | hartmanng@chromium.org <hartmanng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 04:57:03 +0000 |
commit | 4229cfe9358eab93c43f2ecf3d0e1df7b9bc9ee2 (patch) | |
tree | 2d36e44628a61ac61bd5f9ee5e634711549dce0d | |
parent | d9f65826a0216130385ed02ca355d37bc6de202a (diff) | |
download | chromium_src-4229cfe9358eab93c43f2ecf3d0e1df7b9bc9ee2.zip chromium_src-4229cfe9358eab93c43f2ecf3d0e1df7b9bc9ee2.tar.gz chromium_src-4229cfe9358eab93c43f2ecf3d0e1df7b9bc9ee2.tar.bz2 |
Fix --enable-stats-table crash on Release builds.
Currently, using the --enable-stats-table flag when running a Release build of chromium causes a segfault on startup.
I traced the issue back to a dangling reference to a local variable that had gone out of scope, so dynamically allocating the variable and storing it as a class member fixes the issue.
BUG=137243
Review URL: https://chromiumcodereview.appspot.com/11260033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164848 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/chrome_main_delegate.cc | 4 | ||||
-rw-r--r-- | chrome/app/chrome_main_delegate.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index 3b1f0ec..fce7ccb 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc @@ -559,9 +559,9 @@ void ChromeMainDelegate::PreSandboxStartup() { chrome::ProcessNeedsProfileDir(process_type))); } - base::StatsCounterTimer stats_counter_timer("Chrome.Init"); + stats_counter_timer_.reset(new base::StatsCounterTimer("Chrome.Init")); startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer> - (stats_counter_timer)); + (*stats_counter_timer_)); // Enable the heap profiler as early as possible! EnableHeapProfiler(command_line); diff --git a/chrome/app/chrome_main_delegate.h b/chrome/app/chrome_main_delegate.h index f8f6e2a..2e63bef 100644 --- a/chrome/app/chrome_main_delegate.h +++ b/chrome/app/chrome_main_delegate.h @@ -48,6 +48,7 @@ class ChromeMainDelegate : public content::ContentMainDelegate { chrome::ChromeContentClient chrome_content_client_; scoped_ptr<base::StatsScope<base::StatsCounterTimer> > startup_timer_; + scoped_ptr<base::StatsCounterTimer> stats_counter_timer_; DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate); }; |