summaryrefslogtreecommitdiff
path: root/src/stream.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-01 01:47:06 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-01 01:47:06 -0400
commit559a76ac2bb744fcef92fdc602bce7ba21cd52be (patch)
tree2298d9ae4a3e1b839f062c07dcd8e0ede2014652 /src/stream.h
parent9d267fa1331a570e2b4c978f0b35a107a47b51c1 (diff)
downloadfork-ledger-559a76ac2bb744fcef92fdc602bce7ba21cd52be.tar.gz
fork-ledger-559a76ac2bb744fcef92fdc602bce7ba21cd52be.tar.bz2
fork-ledger-559a76ac2bb744fcef92fdc602bce7ba21cd52be.zip
Fixed the way the pager process was being handled.
Diffstat (limited to 'src/stream.h')
-rw-r--r--src/stream.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/stream.h b/src/stream.h
index 4c4dd366..919c801d 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -76,7 +76,7 @@ public:
/**
* Construct a new output_stream_t.
*/
- output_stream_t() : pipe_to_pager_fd(-1), os(NULL) {
+ output_stream_t() : pipe_to_pager_fd(-1), os(&std::cout) {
TRACE_CTOR(output_stream_t, "");
}
@@ -85,7 +85,10 @@ public:
* allocated ostream, if necessary. It also closes output file
* descriptor, if necessary.
*/
- ~output_stream_t();
+ ~output_stream_t() {
+ TRACE_DTOR(output_stream_t);
+ close();
+ }
/**
* Initialize the output stream object.
@@ -113,6 +116,11 @@ public:
void flush() {
os->flush();
}
+
+ /**
+ * Close the output stream, waiting on the pager process if necessary.
+ */
+ void close();
};
} // namespace ledger