Index: trunk/BNC/src/upload/bncuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 9745)
+++ trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 9746)
@@ -194,11 +194,12 @@
   }
 
-  if (_outSocket != 0) {
-    if (_outSocket->state() == QAbstractSocket::ConnectedState) {
-      return;
-    }
-    delete _outSocket;
-    _outSocket = 0;
-  }
+  if (_outSocket) {
+    if( _outSocket->state() == QAbstractSocket::ConnectedState) {
+      return;
+    }
+    disconnect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
+  }
+  delete _outSocket;
+  _outSocket = 0;
 
   double minDt = pow(2.0, _sOpenTrial);
