Make sure to close the file before deleting it

llvm-svn: 3905
This commit is contained in:
Chris Lattner 2002-09-24 00:09:48 +00:00
parent 4e11d9e5de
commit 2ccb52142f
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;
}