Make sure to close the file before deleting it

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3905 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-09-24 00:09:48 +00:00
parent 3abb95df01
commit 93c26685bf
3 changed files with 12 additions and 3 deletions

View File

@ -115,7 +115,10 @@ int main(int argc, char **argv) {
Passes.run(*M.get());
if (Out != &std::cout) delete Out;
if (Out != &std::cout) {
((std::ofstream*)Out)->close();
delete Out;
}
return 0;
}

View File

@ -115,7 +115,10 @@ int main(int argc, char **argv) {
Passes.run(*M.get());
if (Out != &std::cout) delete Out;
if (Out != &std::cout) {
((std::ofstream*)Out)->close();
delete Out;
}
return 0;
}

View File

@ -115,7 +115,10 @@ int main(int argc, char **argv) {
Passes.run(*M.get());
if (Out != &std::cout) delete Out;
if (Out != &std::cout) {
((std::ofstream*)Out)->close();
delete Out;
}
return 0;
}