Index: trunk/BNC/bnczerodecoder.cpp
===================================================================
--- trunk/BNC/bnczerodecoder.cpp	(revision 426)
+++ trunk/BNC/bnczerodecoder.cpp	(revision 427)
@@ -43,4 +43,5 @@
   _fileName = path + fileName;
 
+  _out = 0;
   reopen();
 }
@@ -49,5 +50,5 @@
 //////////////////////////////////////////////////////////////////////// 
 bncZeroDecoder::~bncZeroDecoder() {
-  _out.close();
+  delete _out;
 }
 
@@ -56,7 +57,8 @@
 void bncZeroDecoder::reopen() {
   QDate currDate = QDate::currentDate();
-  if (!_fileDate.isValid() || _fileDate != currDate) {
-    _out.close();
-    _out.open( (_fileName + "_" + currDate.toString("yyMMdd")).toAscii().data());
+  if (!_out || _fileDate != currDate) {
+    delete _out;
+    _out = new ofstream( (_fileName + "_" + 
+                          currDate.toString("yyMMdd")).toAscii().data() );
     _fileDate = currDate;
   }
@@ -67,6 +69,6 @@
 void bncZeroDecoder::Decode(char* buffer, int bufLen) {
   reopen();
-  _out.write(buffer, bufLen);
-  _out.flush();
+  _out->write(buffer, bufLen);
+  _out->flush();
 }
 
Index: trunk/BNC/bnczerodecoder.h
===================================================================
--- trunk/BNC/bnczerodecoder.h	(revision 426)
+++ trunk/BNC/bnczerodecoder.h	(revision 427)
@@ -39,5 +39,5 @@
     void reopen();
     QString        _fileName;
-    std::ofstream  _out;
+    std::ofstream* _out;
     QDate          _fileDate;
 };
