summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Timer.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-12-13 16:04:04 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-12-13 16:04:04 +0000
commit53bd3d0b1a0ae5550578c7b341a7f55e620d8773 (patch)
tree00e9b6c7953dadffcfc784b93139d92bf3b16277 /llvm/lib/Support/Timer.cpp
parenta125162bb0306a92cce3f03e9e837f98f2cbb032 (diff)
downloadbcm5719-llvm-53bd3d0b1a0ae5550578c7b341a7f55e620d8773.tar.gz
bcm5719-llvm-53bd3d0b1a0ae5550578c7b341a7f55e620d8773.zip
Get rid of some leaks found by VC leak detector.
Patch contributed by Morten Ofsted. llvm-svn: 18889
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r--llvm/lib/Support/Timer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index ff3fd6fefe0..4b88be2b094 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud