diff --git a/docs/changes.txt b/docs/changes.txt index 720a221077..7778da28d2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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): diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index a0c120aa75..206e868051 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -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; diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index c3a082efb9..91e3edf860 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -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); diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index 69c8418644..45b337ed66 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -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!)