Try and avoid a crash by suppressing the socket events first before deleting

Might fix a sentry issue, unknown
This commit is contained in:
Marek Roszko 2022-09-28 21:17:37 -04:00
parent 0b59ef4741
commit 0b1b37a75f
1 changed files with 7 additions and 1 deletions

View File

@ -51,7 +51,13 @@ void KIWAY_PLAYER::CreateServer( int service, bool local )
if( local )
addr.Hostname( HOSTNAME );
delete m_socketServer;
// this helps kill any events that could come in during deletion
if( m_socketServer )
{
m_socketServer->Notify( false );
delete m_socketServer;
}
m_socketServer = new wxSocketServer( addr );
m_socketServer->SetNotify( wxSOCKET_CONNECTION_FLAG );