diff options
Diffstat (limited to 'Common/ErrorHandler.cpp')
-rw-r--r-- | Common/ErrorHandler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Common/ErrorHandler.cpp b/Common/ErrorHandler.cpp index d1cb3dbbe03c..c059516daf94 100644 --- a/Common/ErrorHandler.cpp +++ b/Common/ErrorHandler.cpp @@ -47,8 +47,9 @@ ErrorHandler &lld::errorHandler() { } void lld::exitLld(int Val) { - // Delete the output buffer so that any tempory file is deleted. - errorHandler().OutputBuffer.reset(); + // Delete any temporary file, while keeping the memory mapping open. + if (errorHandler().OutputBuffer) + errorHandler().OutputBuffer->discard(); // Dealloc/destroy ManagedStatic variables before calling // _exit(). In a non-LTO build, this is a nop. In an LTO |