Don't use listensocket if portbind failed. Fixes crash when port can't be bound to.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2552
This commit is contained in:
parent
dba2dbcbd3
commit
6a48704051
1 changed files with 6 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: softmodem.cpp,v 1.4 2006-02-26 13:48:06 qbix79 Exp $ */
|
||||
/* $Id: softmodem.cpp,v 1.5 2006-03-24 17:11:35 qbix79 Exp $ */
|
||||
|
||||
#include "dosbox.h"
|
||||
|
||||
|
@ -256,9 +256,11 @@ void CSerialModem::EnterIdleState(void){
|
|||
SDLNet_TCP_Close(incomingsocket);
|
||||
}
|
||||
// get rid of everything
|
||||
while(incomingsocket=SDLNet_TCP_Accept(listensocket)) {
|
||||
SDLNet_TCP_DelSocket(socketset,incomingsocket);
|
||||
SDLNet_TCP_Close(incomingsocket);
|
||||
if(listensocket) {
|
||||
while(incomingsocket=SDLNet_TCP_Accept(listensocket)) {
|
||||
SDLNet_TCP_DelSocket(socketset,incomingsocket);
|
||||
SDLNet_TCP_Close(incomingsocket);
|
||||
}
|
||||
}
|
||||
incomingsocket=0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue