Skip to content

Commit 97079a4

Browse files
committed
Always use CSteamNetworkListenSocketBase::Destroy().
And hide destructor so it cannot be called directly.
1 parent dcf33ff commit 97079a4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/steamnetworkingsockets/clientlib/csteamnetworkingsockets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ HSteamListenSocket CSteamNetworkingSockets::CreateListenSocketIP( const SteamNet
590590
if ( !pSock->BInit( localAddr, nOptions, pOptions, errMsg ) )
591591
{
592592
SpewError( "Cannot create listen socket. %s", errMsg );
593-
delete pSock;
593+
pSock->Destroy();
594594
return k_HSteamListenSocket_Invalid;
595595
}
596596

src/steamnetworkingsockets/clientlib/steamnetworkingsockets_udp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ class CSteamNetworkListenSocketDirectUDP : public CSteamNetworkListenSocketBase
2121
{
2222
public:
2323
CSteamNetworkListenSocketDirectUDP( CSteamNetworkingSockets *pSteamNetworkingSocketsInterface );
24-
virtual ~CSteamNetworkListenSocketDirectUDP();
2524
virtual bool APIGetAddress( SteamNetworkingIPAddr *pAddress ) override;
2625

2726
/// Setup
2827
bool BInit( const SteamNetworkingIPAddr &localAddr, int nOptions, const SteamNetworkingConfigValue_t *pOptions, SteamDatagramErrMsg &errMsg );
2928

3029
private:
30+
virtual ~CSteamNetworkListenSocketDirectUDP(); // hidden destructor, don't call directly. Use Destroy()
3131

3232
/// The socket we are bound to. We own this socket.
3333
/// Any connections accepted through us become clients of this shared socket.

0 commit comments

Comments
 (0)