From e3691dbc13b94e0a304ff3bf6e69f070d0e3fcd1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 16 Apr 2021 22:30:09 +0100 Subject: [PATCH] Explain reason for invalidating gs_tlsThisThread better Just improve a comment, no real changes. --- src/msw/thread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index f947c2a156..2b22bd61c2 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -1266,8 +1266,9 @@ void wxThreadModule::OnExit() wxLogLastError(wxT("TlsFree failed.")); } - // invalidate slot index to prevent wxThread from trying to reuse it if the - // library is initialized again later + // invalidate slot index to make the errors more obvious if we try to use + // it from now on, e.g. if any wxThreads are still running (which shouldn't + // be the case, of course, but might still happen) gs_tlsThisThread = TLS_OUT_OF_INDEXES; if ( gs_critsectGui )