Guard against NULL Sockets
I’ve not been able to reproduce it always, but when using wxHTTP the internal socket was sometimes already closed. So just guard against crashes.
This commit is contained in:
parent
14fb1c5fe1
commit
fab9a67d23
1 changed files with 4 additions and 2 deletions
|
|
@ -263,7 +263,8 @@ void wxSocketManagerMac::Install_Callback(wxSocketImpl *socket_,
|
|||
{
|
||||
wxSocketImplMac * const socket = static_cast<wxSocketImplMac *>(socket_);
|
||||
|
||||
CFSocketEnableCallBacks(socket->GetSocket(), GetCFCallback(socket, event));
|
||||
if ( socket->GetSocket() )
|
||||
CFSocketEnableCallBacks(socket->GetSocket(), GetCFCallback(socket, event));
|
||||
}
|
||||
|
||||
void wxSocketManagerMac::Uninstall_Callback(wxSocketImpl *socket_,
|
||||
|
|
@ -271,7 +272,8 @@ void wxSocketManagerMac::Uninstall_Callback(wxSocketImpl *socket_,
|
|||
{
|
||||
wxSocketImplMac * const socket = static_cast<wxSocketImplMac *>(socket_);
|
||||
|
||||
CFSocketDisableCallBacks(socket->GetSocket(), GetCFCallback(socket, event));
|
||||
if ( socket->GetSocket() )
|
||||
CFSocketDisableCallBacks(socket->GetSocket(), GetCFCallback(socket, event));
|
||||
}
|
||||
|
||||
// set the wxBase variable to point to CF wxSocketManager implementation so
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue