summaryrefslogtreecommitdiffstats
path: root/libvncserver/rfbserver.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncserver/rfbserver.c')
-rw-r--r--libvncserver/rfbserver.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index fceb02c..22bdc98 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -235,6 +235,9 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
rfbResetStats(cl);
+ cl->clientData = NULL;
+ cl->clientGoneHook = rfbDoNothingWithClient;
+
if(isUDP) {
rfbLog(" accepted UDP client\n");
} else {
@@ -353,8 +356,6 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
}
}
- cl->clientData = NULL;
- cl->clientGoneHook = rfbDoNothingWithClient;
switch (cl->screen->newClientHook(cl)) {
case RFB_CLIENT_ON_HOLD:
cl->onHold = TRUE;
@@ -458,7 +459,9 @@ rfbClientConnectionGone(rfbClientPtr cl)
TINI_COND(cl->updateCond);
TINI_MUTEX(cl->updateMutex);
+ /* make sure outputMutex is unlocked before destroying */
LOCK(cl->outputMutex);
+ UNLOCK(cl->outputMutex);
TINI_MUTEX(cl->outputMutex);
#ifdef CORBA