Mercurial > hg > svcore
comparison transform/FileFeatureWriter.cpp @ 531:38b1ddf18d4b
* Try to avoid leaving output files open after completion
author | Chris Cannam |
---|---|
date | Tue, 20 Jan 2009 18:11:10 +0000 |
parents | 12608139f6bc |
children | e0a1ff10cc7b |
comparison
equal
deleted
inserted
replaced
530:1d3fc01edc03 | 531:38b1ddf18d4b |
---|---|
283 if (m_prevstream) { | 283 if (m_prevstream) { |
284 m_prevstream->flush(); | 284 m_prevstream->flush(); |
285 } | 285 } |
286 } | 286 } |
287 | 287 |
288 | |
289 void | |
290 FileFeatureWriter::finish() | |
291 { | |
292 cerr << "FileFeatureWriter::finish()" << endl; | |
293 | |
294 if (m_singleFileName != "" || m_stdout) return; | |
295 | |
296 while (!m_streams.empty()) { | |
297 m_streams.begin()->second->flush(); | |
298 delete m_streams.begin()->second; | |
299 m_streams.erase(m_streams.begin()); | |
300 } | |
301 while (!m_files.empty()) { | |
302 delete m_files.begin()->second; | |
303 m_files.erase(m_files.begin()); | |
304 } | |
305 m_prevstream = 0; | |
306 } | |
307 |