Index: trunk/BNC/src/bncgetthread.cpp
===================================================================
--- trunk/BNC/src/bncgetthread.cpp	(revision 5868)
+++ trunk/BNC/src/bncgetthread.cpp	(revision 5869)
@@ -413,7 +413,7 @@
           cout << "no more data" << endl;
           BNC_CORE->stopCombination();
-          QThread::exit(0);
-          delete this;
-          ::exit(0);
+          emit finished();
+          this->deleteLater();
+          return;
         }
       }
Index: trunk/BNC/src/bncmain.cpp
===================================================================
--- trunk/BNC/src/bncmain.cpp	(revision 5868)
+++ trunk/BNC/src/bncmain.cpp	(revision 5869)
@@ -218,4 +218,5 @@
                                                bncRawFile::input);
       bncGetThread* getThread = new bncGetThread(rawFile);
+      QObject::connect(getThread, SIGNAL(finished()), pppMain, SLOT(slotStop()));
       caster->addGetThread(getThread, true);
     }
