Don't create CFSocket unnecessarily when closing wxSocket
DoClose() shouldn't do anything if CFSocket hadn't been created at all (as will be the case for blocking sockets) instead of creating it only to destroy it immediately afterwards.
This commit is contained in:
@@ -63,6 +63,12 @@ public:
|
||||
private:
|
||||
virtual void DoClose() wxOVERRIDE
|
||||
{
|
||||
// No need to do anything if we had never created the underlying
|
||||
// socket: this avoids creating it from Uninstall_Callback() completely
|
||||
// unnecessarily.
|
||||
if ( !m_socket )
|
||||
return;
|
||||
|
||||
wxSocketManager * const manager = wxSocketManager::Get();
|
||||
if ( manager )
|
||||
{
|
||||
|
Reference in New Issue
Block a user