X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a9f4542f8a6f349acb424081ed19a885c2da697b..e3c0dc265f336dc28bedc6b460961556ff5d209c:/wxPython/samples/embedded/embedded.cpp diff --git a/wxPython/samples/embedded/embedded.cpp b/wxPython/samples/embedded/embedded.cpp index c3766e20b0..50b8b1a34a 100644 --- a/wxPython/samples/embedded/embedded.cpp +++ b/wxPython/samples/embedded/embedded.cpp @@ -42,7 +42,7 @@ public: virtual ~MyApp(); void Init_wxPython(); private: - PyThreadState* main_tstate; + PyThreadState* m_mainTState; }; @@ -83,16 +83,22 @@ void MyApp::Init_wxPython() // module and sets a pointer to a function table located there. wxPyCoreAPI_IMPORT(); + // Ensure that the new classes defined in the wxPython wrappers are + // recognised by the wx RTTI system. (If you don't use wxWindow in + // your C++ app you won't need to do this.) + wxClassInfo::CleanUpClasses(); + wxClassInfo::InitializeClasses(); + // Save the current Python thread state and release the // Global Interpreter Lock. - main_tstate = wxPyBeginAllowThreads(); + m_mainTState = wxPyBeginAllowThreads(); } MyApp::~MyApp() { // Restore the thread state and tell Python to cleanup after itself. - wxPyEndAllowThreads(main_tstate); + wxPyEndAllowThreads(m_mainTState); Py_Finalize(); }