Commit 7c9076f7 authored by Urs Wolfer's avatar Urs Wolfer

* VNC stability fix

Patch by Patch by Wouter Van Meir <wouter.vanmeir pandora.be>, thanks.

REVIEW:4507

svn path=/trunk/KDE/kdenetwork/krdc/; revision=1145843
parent 35e64db0
......@@ -205,7 +205,8 @@ VncClientThread::~VncClientThread()
{
if(isRunning()) {
stop();
const bool quitSuccess = wait(500);
terminate();
const bool quitSuccess = wait(1000);
kDebug(5011) << "Attempting to stop in deconstructor, will crash if this fails:" << quitSuccess;
}
......
......@@ -85,14 +85,6 @@ VncView::VncView(QWidget *parent, const KUrl &url, KConfigGroup configGroup)
VncView::~VncView()
{
unpressModifiers();
// Disconnect all signals so that we don't get any more callbacks from the client thread
disconnect(&vncThread, SIGNAL(imageUpdated(int, int, int, int)), this, SLOT(updateImage(int, int, int, int)));
disconnect(&vncThread, SIGNAL(gotCut(const QString&)), this, SLOT(setCut(const QString&)));
disconnect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword()));
disconnect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString)));
startQuitting();
}
......@@ -163,6 +155,16 @@ void VncView::startQuitting()
{
kDebug(5011) << "about to quit";
unpressModifiers();
// Disconnect all signals so that we don't get any more callbacks from the client thread
bool imageUpdatedDisconnect = disconnect(&vncThread, SIGNAL(imageUpdated(int, int, int, int)), this, SLOT(updateImage(int, int, int, int)));
bool gotCutDisconnect = disconnect(&vncThread, SIGNAL(gotCut(const QString&)), this, SLOT(setCut(const QString&)));
bool passwordRequestDisconnect = disconnect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword()));
bool outputErrorMessageDisconnect = disconnect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString)));
kDebug(5011) << "Signals disconnected: imageUpdated: " << imageUpdatedDisconnect << "gotCut: " << gotCutDisconnect << "passwordRequest: " << passwordRequestDisconnect << "outputErrorMessage: " << outputErrorMessageDisconnect;
const bool connected = status() == RemoteView::Connected;
setStatus(Disconnecting);
......@@ -175,7 +177,7 @@ void VncView::startQuitting()
vncThread.quit();
const bool quitSuccess = vncThread.wait(500);
const bool quitSuccess = vncThread.wait(1000);
kDebug(5011) << "Quit VNC thread success:" << quitSuccess;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment