mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
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
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user