This should fix core crash on exit on some *cough* systems. Not quite tested, thanks to
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 22 Feb 2008 01:40:13 +0000 (01:40 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 22 Feb 2008 01:40:13 +0000 (01:40 +0000)
Belgian beer. But when I really concentrate, I can almost see the Ballmer Peak down there...

src/core/networkconnection.cpp

index 84eabee..93568b0 100644 (file)
@@ -245,15 +245,17 @@ void NetworkConnection::sendPerform() {
 }
 
 void NetworkConnection::disconnectFromIrc(bool requested) {
-  if(requested) {
-    _autoReconnectTimer.stop();
-    _autoReconnectCount = 0;
-  }
+  _autoReconnectTimer.stop();
+  _autoReconnectCount = 0;
   displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Disconnecting."));
   if(socket.state() < QAbstractSocket::ConnectedState) {
     setConnectionState(Network::Disconnected);
     socketDisconnected();
   } else socket.disconnectFromHost();
+
+  if(requested) {
+    emit quitRequested(networkId());
+  }
 }
 
 void NetworkConnection::socketHasData() {
@@ -314,8 +316,7 @@ void NetworkConnection::socketDisconnected() {
   _whoTimer.stop();
   network()->setConnected(false);
   emit disconnected(networkId());
-  if(_autoReconnectCount == 0) emit quitRequested(networkId());
-  else {
+  if(_autoReconnectCount != 0) {
     setConnectionState(Network::Reconnecting);
     if(_autoReconnectCount == network()->autoReconnectRetries()) doAutoReconnect(); // first try is immediate
     else _autoReconnectTimer.start();