diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 18:03:34 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 18:03:34 +0000 |
commit | f96fe2c4946af3e6f51e07ea27bf25cef02b9426 (patch) | |
tree | 94a3365c927aa6e81408c9f855763b93ef4bd970 /base/command_line.cc | |
parent | 04eb2a4471cd1bcfbedd711360d5eaa1dc0d2bdf (diff) | |
download | chromium_src-f96fe2c4946af3e6f51e07ea27bf25cef02b9426.zip chromium_src-f96fe2c4946af3e6f51e07ea27bf25cef02b9426.tar.gz chromium_src-f96fe2c4946af3e6f51e07ea27bf25cef02b9426.tar.bz2 |
Base: Don't delete the previous command line when calling
CommandLine::Init()
In the multi-DLL build, we can end up initializing the object
twice at startup (once in chrome.exe and once in chrome.dll).
It should be harmless.
BUG=76996
TEST=base_unittests
Review URL: http://codereview.chromium.org/7273053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92380 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line.cc')
-rw-r--r-- | base/command_line.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/base/command_line.cc b/base/command_line.cc index b3a79eb..acf2502 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -168,7 +168,13 @@ CommandLine::~CommandLine() { // static void CommandLine::Init(int argc, const char* const* argv) { - delete current_process_commandline_; + if (current_process_commandline_) { + // If this is intentional, Reset() must be called first. If we are using + // the shared build mode, we have to share a single object across multiple + // shared libraries. + return; + } + current_process_commandline_ = new CommandLine(NO_PROGRAM); #if defined(OS_WIN) current_process_commandline_->ParseFromString(::GetCommandLineW()); |