Browse Source

SDLvncviewer: don't call clean up the same client twice.

If rfbInitConnection fails, it cleans up the client, so protect against
doing it ourselves again.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
pull/1/head
Christian Beier 13 years ago committed by Johannes Schindelin
parent
commit
76b468ceb0
  1. 4
      client_examples/SDLvncviewer.c

4
client_examples/SDLvncviewer.c

@ -356,7 +356,8 @@ static void cleanup(rfbClient* cl)
*/
SDL_QuitSubSystem(SDL_INIT_VIDEO);
SDL_InitSubSystem(SDL_INIT_VIDEO);
rfbClientCleanup(cl);
if(cl)
rfbClientCleanup(cl);
}
@ -513,6 +514,7 @@ int main(int argc,char** argv) {
cl->listenPort = LISTEN_PORT_OFFSET;
if(!rfbInitClient(cl,&argc,argv))
{
cl = NULL; /* rfbInitClient has already freed the client struct */
cleanup(cl);
break;
}

Loading…
Cancel
Save