summaryrefslogtreecommitdiffstats
path: root/x11vnc.c
diff options
context:
space:
mode:
authordscho <dscho>2002-04-25 14:19:04 +0000
committerdscho <dscho>2002-04-25 14:19:04 +0000
commit11deabd325f252b900754b2830cd2b600c302ca1 (patch)
tree0cdaeb1212bf5da270794b14b279eafcb90a99a8 /x11vnc.c
parentefa12fa978ca10c329e4cb14fefa597a6d93f2e8 (diff)
downloadlibtdevnc-11deabd325f252b900754b2830cd2b600c302ca1.tar.gz
libtdevnc-11deabd325f252b900754b2830cd2b600c302ca1.zip
x11vnc memleaks patched
Diffstat (limited to 'x11vnc.c')
-rw-r--r--x11vnc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/x11vnc.c b/x11vnc.c
index 922ba84..2ffb7e6 100644
--- a/x11vnc.c
+++ b/x11vnc.c
@@ -73,11 +73,13 @@ void init_keycodes()
XFree ((char *) keymap);
}
+static Bool shutDownServer=0;
+
/* the hooks */
void clientGone(rfbClientPtr cl)
{
- exit(0);
+ shutDownServer=-1;
}
enum rfbNewClientAction newClient(rfbClientPtr cl)
@@ -502,6 +504,15 @@ int main(int argc,char** argv)
#endif
rfbProcessEvents(screen,-1);
+ if(shutDownServer) {
+ free(backupImage);
+ rfbScreenCleanup(screen);
+ XFree(dpy);
+#ifndef NO_SHM
+ XShmDetach(dpy,framebufferImage);
+#endif
+ exit(0);
+ }
if(dontTile) {
if(gotInput) {