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
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include "wx/object.h"
|
#include "wx/object.h"
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/intl.h"
|
#include "wx/intl.h"
|
||||||
|
#include "wx/thread.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -734,7 +735,7 @@ int wxSockAddress::GetAddressDataLen() const
|
|||||||
|
|
||||||
void wxSockAddress::Init()
|
void wxSockAddress::Init()
|
||||||
{
|
{
|
||||||
if ( !wxSocketBase::IsInitialized() )
|
if ( wxIsMainThread() && !wxSocketBase::IsInitialized() )
|
||||||
{
|
{
|
||||||
// we must do it before using any socket functions
|
// we must do it before using any socket functions
|
||||||
(void)wxSocketBase::Initialize();
|
(void)wxSocketBase::Initialize();
|
||||||
|
Reference in New Issue
Block a user