From ed2e973e9f0701e3f86d943da83b0d1d078b6e6f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Sep 2009 14:45:45 +0000 Subject: [PATCH] Don't call wxSocketBase::IsInitialized() from worker threads. This function should be used in the main thread only and calling it from wxSockAddress unconditionally resulted in asserts in the unit test. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61997 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/sckaddr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); -- 2.50.0