- @code
- class MyApp : public wxApp
- {
- public:
- wxCHMHelpController m_helpCtrl;
- ...
- };
- @endcode
-
- The reason for that is that @c m_helpCtrl is a member object and is
- thus destroyed from MyApp destructor. But MyApp object is deleted after
- wxWidgets structures that wxCHMHelpController depends on were
- uninitialized! The solution is to destroy HelpCtrl in @e OnExit:
-
- @code
- class MyApp : public wxApp
- {
- public:
- wxCHMHelpController *m_helpCtrl;
- ...
- };
-
- bool MyApp::OnInit()
- {
- ...
- m_helpCtrl = new wxCHMHelpController;
- ...
- }
-
- int MyApp::OnExit()
- {
- delete m_helpCtrl;
- return 0;
- }
- @endcode
+The reason for that is that @c m_helpCtrl is a member object and is thus
+destroyed from MyApp destructor. But MyApp object is deleted after wxWidgets
+structures that wxCHMHelpController depends on were uninitialized! The solution
+is to destroy HelpCtrl in @e OnExit:
+
+@code
+class MyApp : public wxApp
+{
+public:
+ wxCHMHelpController *m_helpCtrl;
+ ...
+};
+
+bool MyApp::OnInit()
+{
+ ...
+ m_helpCtrl = new wxCHMHelpController;
+ ...
+}
+
+int MyApp::OnExit()
+{
+ delete m_helpCtrl;
+ return 0;
+}
+@endcode