diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 16:04:04 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 16:04:04 +0000 |
commit | 4af3da6e6b5607e4ec19c9b3f995feeb6fb70ae5 (patch) | |
tree | 154ecc1aba6db923a26b82af54eff0cd8602f63f /lib/Support/Timer.cpp | |
parent | 145f8577dbd45510f2300cfe1bc858221ec5cfa0 (diff) |
Get rid of some leaks found by VC leak detector.
Patch contributed by Morten Ofsted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Timer.cpp')
-rw-r--r-- | lib/Support/Timer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index ff3fd6fefe..4b88be2b09 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -33,12 +33,10 @@ namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); } // problem is that a Statistic<> object gets destroyed, which ends up calling // 'GetLibSupportInfoOutputFile()' (below), which calls this function. // LibSupportInfoOutputFilename used to be a global variable, but sometimes it -// would get destroyed before the Statistic, causing havoc to ensue. We "fix" -// this by creating the string the first time it is needed and never destroying -// it. +// would get destroyed before the Statistic, causing havoc to ensue. static std::string &getLibSupportInfoOutputFilename() { - static std::string *LibSupportInfoOutputFilename = new std::string(); - return *LibSupportInfoOutputFilename; + static std::string LibSupportInfoOutputFilename; + return LibSupportInfoOutputFilename; } namespace { |