Fix a memory leak when using non-wx threads

The wxThreadSpecificInfo object created by wxThreadSpecificInfo::Get()
was only released by the wxThreadInternal's cleanup, which meant that it
was leaked if wxThreadSpecificInfo::Get() was called by a thread not
created by wxThread, e.g. when using std::async or std::thread.

Fix this by simply using C++11 thread_local and removing the entire
wxThreadSpecificInfo machinery entirely.

See #23535.

Closes #23543.
This commit is contained in:
Antti Nietosvaara 2023-05-10 15:13:08 +03:00 committed by Vadim Zeitlin
parent e85b431686
commit d666d1e222
17 changed files with 15 additions and 272 deletions

View file

@ -484,7 +484,6 @@ BASE_CMN_SRC =
src/common/tarstrm.cpp
src/common/textbuf.cpp
src/common/textfile.cpp
src/common/threadinfo.cpp
src/common/time.cpp
src/common/timercmn.cpp
src/common/timerimpl.cpp