summaryrefslogtreecommitdiffstats
path: root/rfbserver.c
diff options
context:
space:
mode:
authordscho <dscho>2003-02-10 20:21:09 +0000
committerdscho <dscho>2003-02-10 20:21:09 +0000
commit1e4c2e7369860be409964ad1f6f771780b5e2621 (patch)
tree48a1c173ef279966b6c2cac1db2524dcdfdbd99c /rfbserver.c
parent47c481b7ca247b6abdbece512be30427135b7a39 (diff)
downloadlibtdevnc-1e4c2e7369860be409964ad1f6f771780b5e2621.tar.gz
libtdevnc-1e4c2e7369860be409964ad1f6f771780b5e2621.zip
really fixed ClientConnectionGone problem
Diffstat (limited to 'rfbserver.c')
-rw-r--r--rfbserver.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/rfbserver.c b/rfbserver.c
index f8b273c..1403714 100644
--- a/rfbserver.c
+++ b/rfbserver.c
@@ -408,14 +408,14 @@ rfbClientConnectionGone(cl)
#endif
#ifdef HAVE_LIBPTHREAD
- LOCK(cl->refCountMutex);
- if(cl->refCount) {
- UNLOCK(cl->refCountMutex);
- if(cl->screen->backgroundLoop != FALSE)
- WAIT(cl->deleteCond,cl->refCountMutex);
- } else {
- UNLOCK(cl->refCountMutex);
- }
+ if(cl->screen->backgroundLoop != FALSE)
+ do {
+ LOCK(cl->refCountMutex);
+ i=cl->refCount;
+ UNLOCK(cl->refCountMutex);
+ if(i>0)
+ WAIT(cl->deleteCond,cl->refCountMutex);
+ } while(i>0);
#endif
if(cl->sock>=0)