X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/197380a09fb9b151f227edee850e251f28053309..b4c1fe36b9854cdb404906ba3a181a67f9247e0e:/src/common/sckaddr.cpp 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();