diff options
author | dscho <dscho> | 2002-04-25 13:41:52 +0000 |
---|---|---|
committer | dscho <dscho> | 2002-04-25 13:41:52 +0000 |
commit | efa12fa978ca10c329e4cb14fefa597a6d93f2e8 (patch) | |
tree | 5ee9b933785b16c810a3ba5962afb4f7596cbd58 /main.c | |
parent | 160c85f4ecd37b9ab046403e0bc1b5f834a9c3d4 (diff) | |
download | libtdevnc-efa12fa978ca10c329e4cb14fefa597a6d93f2e8.tar.gz libtdevnc-efa12fa978ca10c329e4cb14fefa597a6d93f2e8.zip |
memleaks patched
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -55,7 +55,7 @@ rfbLog(const char *format, ...) time(&log_clock); strftime(buf, 255, "%d/%m/%Y %T ", localtime(&log_clock)); - fprintf(stderr, buf); + fprintf(stderr,buf); vfprintf(stderr, format, args); fflush(stderr); @@ -583,9 +583,19 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv, void rfbScreenCleanup(rfbScreenInfoPtr rfbScreen) { + rfbClientIteratorPtr i=rfbGetClientIterator(rfbScreen); + rfbClientPtr cl,cl1=rfbClientIteratorNext(i); + while(cl1) { + cl=rfbClientIteratorNext(i); + rfbClientConnectionGone(cl1); + cl1=cl; + } + rfbReleaseClientIterator(i); + /* TODO: hang up on all clients and free all reserved memory */ - if(rfbScreen->colourMap.data.bytes) - free(rfbScreen->colourMap.data.bytes); +#define FREE_IF(x) if(rfbScreen->x) free(rfbScreen->x) + FREE_IF(colourMap.data.bytes); + FREE_IF(underCursorBuffer); TINI_MUTEX(rfbScreen->cursorMutex); free(rfbScreen); } |