summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2005-12-07 18:35:48 +0000
committerdscho <dscho>2005-12-07 18:35:48 +0000
commit61204490ce0931b6593bbf8c84647b0a9200a3e5 (patch)
tree7605ef581d608b7934d97e98328d524184585b77
parent6a7736f87a7e6f2f7bb6ea02692bf2a3b704caf8 (diff)
downloadlibtdevnc-61204490.tar.gz
libtdevnc-61204490.zip
plug memory leaks
-rw-r--r--ChangeLog7
-rw-r--r--libvncclient/vncviewer.c19
-rw-r--r--rfb/rfbclient.h1
3 files changed, 25 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index bb08857..5971e66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-07 Giampiero Giancipoli <giampiero.giancipoli@fredreggiane.com>
+ * libvncclient/vncviewer.c: plug memory leaks
+
+2005-12-07 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
+ * client_examples/SDLvncviewer.c: use unicode to determine the keysym
+ (much more reliable than the old method)
+
2005-11-25 Karl Runge <runge@karlrunge.com>
* configure.ac: disable tightvnc-filetransfer if no libpthread.
add --without-pthread option.
diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c
index 31b4d3d..5ef2d9a 100644
--- a/libvncclient/vncviewer.c
+++ b/libvncclient/vncviewer.c
@@ -159,12 +159,10 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
client->decompStreamInited = FALSE;
#endif
-#ifdef LIBVNCSERVER_HAVE_LIBZ
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
memset(client->zlibStreamActive,0,sizeof(rfbBool)*4);
client->jpegSrcManager = NULL;
#endif
-#endif
client->HandleCursorPos = DummyPoint;
client->SoftCursorLockArea = DummyRect;
@@ -254,6 +252,23 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
}
void rfbClientCleanup(rfbClient* client) {
+ int i;
+
+ for ( i = 0; i < 4; i++ ) {
+ if (client->zlibStreamActive[i] == TRUE ) {
+ if (inflateEnd (&client->zlibStream[i]) != Z_OK &&
+ client->zlibStream[i].msg != NULL)
+ rfbClientLog("inflateEnd: %s\n", client->zlibStream[i].msg);
+ }
+ }
+
+ if ( client->decompStreamInited == TRUE ) {
+ if (inflateEnd (&client->decompStream) != Z_OK &&
+ client->decompStream.msg != NULL)
+ rfbClientLog("inflateEnd: %s\n", client->decompStream.msg );
+ }
+
+ free(client->desktopName);
free(client->serverHost);
free(client);
}
diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h
index 8759b0e..a7d77bb 100644
--- a/rfb/rfbclient.h
+++ b/rfb/rfbclient.h
@@ -273,6 +273,7 @@ extern int WaitForMessage(rfbClient* client,unsigned int usecs);
/* vncviewer.c */
rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv);
+/* rfbClientCleanup() does not touch client->frameBuffer */
void rfbClientCleanup(rfbClient* client);
#endif