mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
remove null-dereference when socket closed by two threads
This commit is contained in:
parent
94df6e022c
commit
95772d3ad1
1 changed files with 11 additions and 7 deletions
|
@ -91,6 +91,7 @@ void
|
|||
RemoveSocketRefs( int socket )
|
||||
{
|
||||
CookieRef* cref = getCookieRefForSocket( socket );
|
||||
if ( cref != NULL ) {
|
||||
cref->Remove( socket );
|
||||
|
||||
SocketMap::iterator iter = gSocketStuff.find( socket );
|
||||
|
@ -101,6 +102,9 @@ RemoveSocketRefs( int socket )
|
|||
ForgetCref( cref );
|
||||
delete cref;
|
||||
}
|
||||
} else {
|
||||
logf( "socket already dead" );
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
Loading…
Reference in a new issue