From 79a897b42859037233771d5e643fd3857636be5f Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 9 Feb 2012 05:16:32 -0800 Subject: [PATCH] fix assert (but still leaking) --- xwords4/linux/cursesmain.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index 6a0a637cb..a9cfed385 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -1109,15 +1109,19 @@ static void curses_socket_acceptor( int listener, Acceptor func, CommonGlobals* cGlobals, void** XP_UNUSED(storage) ) { - CursesAppGlobals* globals = (CursesAppGlobals*)cGlobals; - XP_ASSERT( !cGlobals->acceptor || (func == cGlobals->acceptor) ); - cGlobals->acceptor = func; - globals->csInfo.server.serverSocket = listener; - cursesListenOnSocket( globals, listener + if ( -1 == listener ) { + XP_LOGF( "%s: removal of listener not implemented!!!!!", __func__ ); + } else { + CursesAppGlobals* globals = (CursesAppGlobals*)cGlobals; + XP_ASSERT( !cGlobals->acceptor || (func == cGlobals->acceptor) ); + cGlobals->acceptor = func; + globals->csInfo.server.serverSocket = listener; + cursesListenOnSocket( globals, listener #ifdef USE_GLIBLOOP - , fire_acceptor + , fire_acceptor #endif - ); + ); + } } #ifndef USE_GLIBLOOP