Commit 6afdbb5e authored by Urs Wolfer's avatar Urs Wolfer

Fix possible crash when quitting while connecting (VNC).

svn path=/trunk/KDE/kdenetwork/krdc/; revision=1151206
parent 7a379d14
......@@ -192,6 +192,7 @@ VncClientThread::VncClientThread(QObject *parent)
: QThread(parent)
, frameBuffer(0)
, m_stopped(false)
, cl(0)
{
QMutexLocker locker(&mutex);
......@@ -210,8 +211,10 @@ VncClientThread::~VncClientThread()
kDebug(5011) << "Attempting to stop in deconstructor, will crash if this fails:" << quitSuccess;
}
// Disconnect from vnc server & cleanup allocated resources
rfbClientCleanup(cl);
if (cl) {
// Disconnect from vnc server & cleanup allocated resources
rfbClientCleanup(cl);
}
delete [] frameBuffer;
}
......
......@@ -155,6 +155,8 @@ void VncView::startQuitting()
{
kDebug(5011) << "about to quit";
setStatus(Disconnecting);
unpressModifiers();
// Disconnect all signals so that we don't get any more callbacks from the client thread
......@@ -167,8 +169,6 @@ void VncView::startQuitting()
const bool connected = status() == RemoteView::Connected;
setStatus(Disconnecting);
m_quitFlag = true;
if (connected) {
......
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