Always close the last report output stream

Should fix #701
This commit is contained in:
John Wiegley 2012-03-16 15:31:30 -05:00
parent 6305855997
commit 00ff141ee7
3 changed files with 10 additions and 0 deletions

View file

@ -56,6 +56,11 @@ public:
global_scope_t(char ** envp);
~global_scope_t();
void quick_close() {
if (! report_stack.empty())
report_stack.front().quick_close();
}
virtual string description() {
return _("global scope");
}

View file

@ -212,6 +212,7 @@ int main(int argc, char * argv[], char * envp[])
} else
#endif
{
global_scope->quick_close();
INFO("Ledger ended"); // let global_scope leak!
}

View file

@ -125,6 +125,10 @@ public:
output_stream.close();
}
void quick_close() {
output_stream.close();
}
virtual string description() {
return _("current report");
}