summaryrefslogtreecommitdiffstats
path: root/src/client/vnc/vncwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/vnc/vncwindow.cpp')
-rw-r--r--src/client/vnc/vncwindow.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp
index 0854f01..c9c0d93 100644
--- a/src/client/vnc/vncwindow.cpp
+++ b/src/client/vnc/vncwindow.cpp
@@ -49,7 +49,10 @@ void VncWindow::terminateVncThread()
if (_vncWorker == NULL)
return;
- _vncWorker->blockSignals(true);
+ disconnect(_vncWorker, SIGNAL(projectionStopped()), this, SLOT(onProjectionStopped()));
+ disconnect(_vncWorker, SIGNAL(projectionStarted()), this, SLOT(onProjectionStarted()));
+ disconnect(_vncWorker, SIGNAL(imageUpdated(const int, const int, const int, const int)), this,
+ SLOT(onUpdateImage(const int, const int, const int, const int)));
_vncWorker->stop();
_vncWorker = NULL;
if (_redrawTimer != 0) {
@@ -62,6 +65,12 @@ void VncWindow::terminateVncThread()
}
}
+void VncWindow::deleteVncThread()
+{
+ qDebug() << "Deleting thread" << QObject::sender();
+ delete QObject::sender();
+}
+
/**
* Draws given part of the current VNC frame buffer to the window.
* Gets the image from the _vncWorker thread in an unsafe way. :(
@@ -106,6 +115,7 @@ void VncWindow::open(const QString& host, int port, const QString& passwd, bool
connect(_vncWorker, SIGNAL(imageUpdated(const int, const int, const int, const int)), this,
SLOT(onUpdateImage(const int, const int, const int, const int)),
Qt::QueuedConnection);
+ connect(_vncWorker, SIGNAL(finished()), this, SLOT(deleteVncThread()), Qt::QueuedConnection);
setWindowTitle(caption);