Properly close mapped files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19863 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeff Cohen 2005-01-28 01:17:07 +00:00
parent 097b763ebf
commit d19d89a04c
4 changed files with 6 additions and 6 deletions

View File

@ -143,7 +143,7 @@ Archive::Archive(const sys::Path& filename, bool map )
Archive::~Archive() {
// Shutdown the file mapping
if (mapfile) {
mapfile->unmap();
mapfile->close();
delete mapfile;
}
// Delete any ModuleProviders and ArchiveMember's we've allocated as a result

View File

@ -303,7 +303,7 @@ Archive::writeMember(
// Close the mapped file if it was opened
if (mFile != 0) {
mFile->unmap();
mFile->close();
delete mFile;
}
}
@ -442,7 +442,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress){
// Close up shop
FinalFile.close();
arch.unmap();
arch.close();
TmpArchive.destroyFile();
} else {

View File

@ -143,7 +143,7 @@ Archive::Archive(const sys::Path& filename, bool map )
Archive::~Archive() {
// Shutdown the file mapping
if (mapfile) {
mapfile->unmap();
mapfile->close();
delete mapfile;
}
// Delete any ModuleProviders and ArchiveMember's we've allocated as a result

View File

@ -303,7 +303,7 @@ Archive::writeMember(
// Close the mapped file if it was opened
if (mFile != 0) {
mFile->unmap();
mFile->close();
delete mFile;
}
}
@ -442,7 +442,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress){
// Close up shop
FinalFile.close();
arch.unmap();
arch.close();
TmpArchive.destroyFile();
} else {