From: Robin Dunn Date: Wed, 22 Oct 2003 17:23:36 +0000 (+0000) Subject: Save the initial tstate during initialization X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/098d1f0c65618e49a67f567f2736ca9b4ac3102c Save the initial tstate during initialization git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index e71d858d5b..18a46a2f83 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -362,6 +362,10 @@ void __wxPreStart(PyObject* moduleDict) PyEval_InitThreads(); wxPyTStates = new wxPyThreadStateArray; wxPyTMutex = new wxMutex; + + // Save the current (main) thread state in our array + PyThreadState* tstate = wxPyBeginAllowThreads(); + wxPyEndAllowThreads(tstate); #endif // Ensure that the build options in the DLL (or whatever) match this build