From 1cca2da448207537394bc72d535bad38941f4bd8 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 22 Sep 2003 22:04:45 +0000 Subject: [PATCH] Init wxRTTI git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23832 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/samples/embedded/embedded.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wxPython/samples/embedded/embedded.cpp b/wxPython/samples/embedded/embedded.cpp index c3766e20b0..0a3dc40d07 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 wxWindows 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(); }