Commit 61204490 authored by dscho's avatar dscho

plug memory leaks

parent 6a7736f8
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> 2005-11-25 Karl Runge <runge@karlrunge.com>
* configure.ac: disable tightvnc-filetransfer if no libpthread. * configure.ac: disable tightvnc-filetransfer if no libpthread.
add --without-pthread option. add --without-pthread option.
......
...@@ -159,11 +159,9 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel, ...@@ -159,11 +159,9 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
client->decompStreamInited = FALSE; client->decompStreamInited = FALSE;
#endif #endif
#ifdef LIBVNCSERVER_HAVE_LIBZ
#ifdef LIBVNCSERVER_HAVE_LIBJPEG #ifdef LIBVNCSERVER_HAVE_LIBJPEG
memset(client->zlibStreamActive,0,sizeof(rfbBool)*4); memset(client->zlibStreamActive,0,sizeof(rfbBool)*4);
client->jpegSrcManager = NULL; client->jpegSrcManager = NULL;
#endif
#endif #endif
client->HandleCursorPos = DummyPoint; client->HandleCursorPos = DummyPoint;
...@@ -254,6 +252,23 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) { ...@@ -254,6 +252,23 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
} }
void rfbClientCleanup(rfbClient* client) { 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->serverHost);
free(client); free(client);
} }
...@@ -273,6 +273,7 @@ extern int WaitForMessage(rfbClient* client,unsigned int usecs); ...@@ -273,6 +273,7 @@ extern int WaitForMessage(rfbClient* client,unsigned int usecs);
/* vncviewer.c */ /* vncviewer.c */
rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel); rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv); rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv);
/* rfbClientCleanup() does not touch client->frameBuffer */
void rfbClientCleanup(rfbClient* client); void rfbClientCleanup(rfbClient* client);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment