Index: /trunk/BNC/src/bnccaster.cpp
===================================================================
--- /trunk/BNC/src/bnccaster.cpp	(revision 7853)
+++ /trunk/BNC/src/bnccaster.cpp	(revision 7854)
@@ -130,4 +130,7 @@
   while(it.hasNext()){
     bncGetThread* thread = it.next();
+    disconnect(thread, 0, 0, 0);
+    _staIDs.removeAll(thread->staID());
+    _threads.removeAll(thread);
     thread->terminate();
   }
Index: /trunk/BNC/src/bncgetthread.cpp
===================================================================
--- /trunk/BNC/src/bncgetthread.cpp	(revision 7853)
+++ /trunk/BNC/src/bncgetthread.cpp	(revision 7854)
@@ -397,10 +397,15 @@
 void bncGetThread::terminate() {
   _isToBeDeleted = true;
-  if (!isRunning()) {
-    delete this;
-  }
-  _nmeaPortsMap.remove(_staID);
-  delete _nmeaServer;
-  delete _nmeaSockets;
+
+  if(_nmeaPortsMap.contains(_staID)) {
+    _nmeaPortsMap.remove(_staID);
+  }
+  if (_nmeaServer) {
+    delete _nmeaServer;
+  }
+  if (_nmeaSockets) {
+    delete _nmeaSockets;
+  }
+  delete this;
 }
 
Index: /trunk/BNC/src/bncmain.cpp
===================================================================
--- /trunk/BNC/src/bncmain.cpp	(revision 7853)
+++ /trunk/BNC/src/bncmain.cpp	(revision 7854)
@@ -57,7 +57,8 @@
 using namespace std;
 
+
 void catch_signal(int) {
   cout << "Program Interrupted by Ctrl-C" << endl;
-  exit(0);
+  qApp->quit();
 }
 
@@ -497,9 +498,13 @@
     delete bncWin;
   }
+  else {
+    BNC_CORE->stopPPP();
+    BNC_CORE->stopCombination();
+  }
   if (caster) {
-    delete caster;
+    delete caster; caster = 0; BNC_CORE->setCaster(0);
   }
   if (casterEph) {
-    delete casterEph;
+    delete casterEph; casterEph = 0;
   }
   if (rawFile) {
