mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
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:
@ -143,7 +143,7 @@ Archive::Archive(const sys::Path& filename, bool map )
|
|||||||
Archive::~Archive() {
|
Archive::~Archive() {
|
||||||
// Shutdown the file mapping
|
// Shutdown the file mapping
|
||||||
if (mapfile) {
|
if (mapfile) {
|
||||||
mapfile->unmap();
|
mapfile->close();
|
||||||
delete mapfile;
|
delete mapfile;
|
||||||
}
|
}
|
||||||
// Delete any ModuleProviders and ArchiveMember's we've allocated as a result
|
// Delete any ModuleProviders and ArchiveMember's we've allocated as a result
|
||||||
|
@ -303,7 +303,7 @@ Archive::writeMember(
|
|||||||
|
|
||||||
// Close the mapped file if it was opened
|
// Close the mapped file if it was opened
|
||||||
if (mFile != 0) {
|
if (mFile != 0) {
|
||||||
mFile->unmap();
|
mFile->close();
|
||||||
delete mFile;
|
delete mFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -442,7 +442,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress){
|
|||||||
|
|
||||||
// Close up shop
|
// Close up shop
|
||||||
FinalFile.close();
|
FinalFile.close();
|
||||||
arch.unmap();
|
arch.close();
|
||||||
TmpArchive.destroyFile();
|
TmpArchive.destroyFile();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -143,7 +143,7 @@ Archive::Archive(const sys::Path& filename, bool map )
|
|||||||
Archive::~Archive() {
|
Archive::~Archive() {
|
||||||
// Shutdown the file mapping
|
// Shutdown the file mapping
|
||||||
if (mapfile) {
|
if (mapfile) {
|
||||||
mapfile->unmap();
|
mapfile->close();
|
||||||
delete mapfile;
|
delete mapfile;
|
||||||
}
|
}
|
||||||
// Delete any ModuleProviders and ArchiveMember's we've allocated as a result
|
// Delete any ModuleProviders and ArchiveMember's we've allocated as a result
|
||||||
|
@ -303,7 +303,7 @@ Archive::writeMember(
|
|||||||
|
|
||||||
// Close the mapped file if it was opened
|
// Close the mapped file if it was opened
|
||||||
if (mFile != 0) {
|
if (mFile != 0) {
|
||||||
mFile->unmap();
|
mFile->close();
|
||||||
delete mFile;
|
delete mFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -442,7 +442,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress){
|
|||||||
|
|
||||||
// Close up shop
|
// Close up shop
|
||||||
FinalFile.close();
|
FinalFile.close();
|
||||||
arch.unmap();
|
arch.close();
|
||||||
TmpArchive.destroyFile();
|
TmpArchive.destroyFile();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user