diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 9e21624fed..5f2797cf5c 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -31,6 +31,7 @@ #include "wx/object.h" #include "wx/log.h" #include "wx/intl.h" + #include "wx/thread.h" #include #include @@ -734,7 +735,7 @@ int wxSockAddress::GetAddressDataLen() const void wxSockAddress::Init() { - if ( !wxSocketBase::IsInitialized() ) + if ( wxIsMainThread() && !wxSocketBase::IsInitialized() ) { // we must do it before using any socket functions (void)wxSocketBase::Initialize();