fixed crash in wxHtmlHelpController if the help window is still open

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@52470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-03-13 23:29:27 +00:00
parent 2ace713c9a
commit 77392f0261
4 changed files with 8 additions and 2 deletions

View File

@@ -123,6 +123,7 @@ All (GUI):
- Added wxWindow::ClientToWindowSize() and WindowToClientSize() helpers.
- Added wxSizer::ComputeFittingClientSize() and ComputeFittingWindowSize().
- Fixed wxSizer::SetSizeHints() to work when the best size decreases.
- Fixed crash in wxHtmlHelpController if the help window is still open.
All (Unix):

View File

@@ -87,12 +87,13 @@ void wxHtmlHelpController::OnCloseFrame(wxCloseEvent& evt)
{
if (m_Config)
WriteCustomization(m_Config, m_ConfigRoot);
evt.Skip();
OnQuit();
m_helpWindow->SetController(NULL);
if ( m_helpWindow )
m_helpWindow->SetController(NULL);
m_helpWindow = NULL;
m_helpDialog = NULL;
m_helpFrame = NULL;

View File

@@ -90,6 +90,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
wxConfigBase *config, const wxString& rootpath)
{
m_HtmlHelpWin = new wxHtmlHelpWindow(m_Data);
m_HtmlHelpWin->SetController(m_helpController);
if ( config)
m_HtmlHelpWin->UseConfig(config, rootpath);

View File

@@ -592,6 +592,9 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id,
wxHtmlHelpWindow::~wxHtmlHelpWindow()
{
if ( m_helpController )
m_helpController->SetHelpWindow(NULL);
delete m_mergedIndex;
// PopEventHandler(); // wxhtmlhelpcontroller (not any more!)