wxSocket::Initialize() and Shutdown() are for main thread only.
Calling Initialize() from another thread could never work before but it wasn't clear that this was the case so document it in the functions comments and documentation now and add asserts checking that they are called from the main thread only. Also simplify the code as we don't actually need to do any reference-counting here and a simple boolean flag indicating whether the sockets are initialized is enough. Closes #11119. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -710,6 +710,8 @@ public:
|
||||
does anything) but you must call Shutdown() exactly once for every call
|
||||
to Initialize().
|
||||
|
||||
This function should only be called from the main thread.
|
||||
|
||||
@return
|
||||
@true if the sockets can be used, @false if the initialization
|
||||
failed and sockets are not available at all.
|
||||
@@ -721,6 +723,9 @@ public:
|
||||
|
||||
This function undoes the call to Initialize() and must be called after
|
||||
every successful call to Initialize().
|
||||
|
||||
This function should only be called from the main thread, just as
|
||||
Initialize().
|
||||
*/
|
||||
static void Shutdown();
|
||||
|
||||
|
Reference in New Issue
Block a user