1
0

Network: Close the UDP endpoint in destructor.

This commit is contained in:
Mattes D 2015-03-18 13:49:35 +01:00
parent 29e267cac0
commit 0aff42a4bc
2 changed files with 11 additions and 0 deletions

View File

@ -197,6 +197,15 @@ cUDPEndpointImpl::cUDPEndpointImpl(UInt16 a_Port, cUDPEndpoint::cCallbacks & a_C
cUDPEndpointImpl::~cUDPEndpointImpl()
{
Close();
}
void cUDPEndpointImpl::Close(void)
{
if (m_Port == 0)

View File

@ -35,6 +35,8 @@ public:
If a_Port is 0, the OS is free to assign any port number it likes to the endpoint. */
cUDPEndpointImpl(UInt16 a_Port, cUDPEndpoint::cCallbacks & a_Callbacks);
~cUDPEndpointImpl();
// cUDPEndpoint overrides:
virtual void Close(void) override;
virtual bool IsOpen(void) const override;