mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 21:36:13 +01:00
sfTcpListener_accept now returns a null pointer when it fails
This commit is contained in:
1 parent
12b7c5a6a5
commit
91e11cc095
2 files changed
+13
-1
No files matched your search
@@ -82,5 +82,13 @@ sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket** conne
|
||||
CSFML_CHECK_RETURN(connected, sfSocketError);
|
||||
|
||||
*connected = new sfTcpSocket;
|
||||
return static_cast<sfSocketStatus>(listener->This.accept((*connected)->This));
|
||||
sfSocketStatus status = static_cast<sfSocketStatus>(listener->This.accept((*connected)->This));
|
||||
|
||||
if (status != sfSocketDone)
|
||||
{
|
||||
delete *connected;
|
||||
*connected = NULL;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
Reference in new issue
Block a user