summaryrefslogtreecommitdiffstats
path: root/src/client/toolbar/toolbar.cpp
diff options
context:
space:
mode:
authorsr2013-02-05 19:00:11 +0100
committersr2013-02-05 19:00:11 +0100
commit62fb9fd2b4d6e1d8e0c06f70bb7ba08b1f286be7 (patch)
tree5a19e024633de3ccdaf2f182b75374d74bac5dbf /src/client/toolbar/toolbar.cpp
parent[SHARED] Add missing error message if network message parsing fails (diff)
downloadpvs2-62fb9fd2b4d6e1d8e0c06f70bb7ba08b1f286be7.tar.gz
pvs2-62fb9fd2b4d6e1d8e0c06f70bb7ba08b1f286be7.tar.xz
pvs2-62fb9fd2b4d6e1d8e0c06f70bb7ba08b1f286be7.zip
[SERVER/CLIENT] Wait for connection to close properly before deleting socket object
Diffstat (limited to 'src/client/toolbar/toolbar.cpp')
-rw-r--r--src/client/toolbar/toolbar.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp
index 416a68f..6fe7432 100644
--- a/src/client/toolbar/toolbar.cpp
+++ b/src/client/toolbar/toolbar.cpp
@@ -158,11 +158,11 @@ void Toolbar::timerEvent(QTimerEvent* event)
* Slots
*/
-void Toolbar::onDisconnected(QObject* connection)
+void Toolbar::onDisconnected()
{
- if (connection != _connection)
- qDebug("onDisconnect pointer mismatch!");
_connectWindow->setConnected(false);
+ if (_connection != NULL)
+ _connection->blockSignals(true);
_connection = NULL;
lblStatus->setStyleSheet("color:red");
lblStatus->setText(tr("Offline"));
@@ -175,12 +175,12 @@ void Toolbar::onConnected(ServerConnection* connection)
//
if (_connection != NULL)
{
- disconnect(_connection, SIGNAL(destroyed(QObject*)), this, SLOT(onDisconnected(QObject*)));
+ disconnect(_connection, SIGNAL(disconnected()), this, SLOT(onDisconnected()));
_connection->blockSignals(true);
_connection->disconnectFromServer();
}
_connection = connection;
- connect(_connection, SIGNAL(destroyed(QObject*)), this, SLOT(onDisconnected(QObject*)));
+ connect(_connection, SIGNAL(disconnected()), this, SLOT(onDisconnected()));
connect(_connection, SIGNAL(openVnc(const QString&, int, const QString&, bool, bool, const QString&, const int)),
_vnc, SLOT(open(const QString&, int, const QString&, bool, bool, const QString&, const int)));
connect(_connection, SIGNAL(closeVnc()), _vnc, SLOT(close()));