fixed crash in wxHtmlHelpController if the help window is still open
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -88,7 +88,7 @@ public:
|
|||||||
wxHtmlHelpController* GetController() const { return m_helpController; }
|
wxHtmlHelpController* GetController() const { return m_helpController; }
|
||||||
|
|
||||||
/// Sets the help controller associated with the window.
|
/// Sets the help controller associated with the window.
|
||||||
void SetController(wxHtmlHelpController* controller) { m_helpController = controller; }
|
void SetController(wxHtmlHelpController* controller);
|
||||||
|
|
||||||
/// Returns the help window.
|
/// Returns the help window.
|
||||||
wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; }
|
wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; }
|
||||||
|
@@ -87,12 +87,13 @@ void wxHtmlHelpController::OnCloseFrame(wxCloseEvent& evt)
|
|||||||
{
|
{
|
||||||
if (m_Config)
|
if (m_Config)
|
||||||
WriteCustomization(m_Config, m_ConfigRoot);
|
WriteCustomization(m_Config, m_ConfigRoot);
|
||||||
|
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
|
|
||||||
OnQuit();
|
OnQuit();
|
||||||
|
|
||||||
m_helpWindow->SetController(NULL);
|
if ( m_helpWindow )
|
||||||
|
m_helpWindow->SetController(NULL);
|
||||||
m_helpWindow = NULL;
|
m_helpWindow = NULL;
|
||||||
m_helpDialog = NULL;
|
m_helpDialog = NULL;
|
||||||
m_helpFrame = NULL;
|
m_helpFrame = NULL;
|
||||||
|
@@ -85,12 +85,20 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data)
|
|||||||
m_helpController = (wxHtmlHelpController*) NULL;
|
m_helpController = (wxHtmlHelpController*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxHtmlHelpFrame::SetController(wxHtmlHelpController* controller)
|
||||||
|
{
|
||||||
|
m_helpController = controller;
|
||||||
|
if ( m_HtmlHelpWin )
|
||||||
|
m_HtmlHelpWin->SetController(controller);
|
||||||
|
}
|
||||||
|
|
||||||
// Create: builds the GUI components.
|
// Create: builds the GUI components.
|
||||||
bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
|
||||||
const wxString& WXUNUSED(title), int style,
|
const wxString& WXUNUSED(title), int style,
|
||||||
wxConfigBase *config, const wxString& rootpath)
|
wxConfigBase *config, const wxString& rootpath)
|
||||||
{
|
{
|
||||||
m_HtmlHelpWin = new wxHtmlHelpWindow(m_Data);
|
m_HtmlHelpWin = new wxHtmlHelpWindow(m_Data);
|
||||||
|
m_HtmlHelpWin->SetController(m_helpController);
|
||||||
if ( config)
|
if ( config)
|
||||||
m_HtmlHelpWin->UseConfig(config, rootpath);
|
m_HtmlHelpWin->UseConfig(config, rootpath);
|
||||||
|
|
||||||
|
@@ -592,6 +592,9 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id,
|
|||||||
|
|
||||||
wxHtmlHelpWindow::~wxHtmlHelpWindow()
|
wxHtmlHelpWindow::~wxHtmlHelpWindow()
|
||||||
{
|
{
|
||||||
|
if ( m_helpController )
|
||||||
|
m_helpController->SetHelpWindow(NULL);
|
||||||
|
|
||||||
delete m_mergedIndex;
|
delete m_mergedIndex;
|
||||||
|
|
||||||
// PopEventHandler(); // wxhtmlhelpcontroller (not any more!)
|
// PopEventHandler(); // wxhtmlhelpcontroller (not any more!)
|
||||||
|
Reference in New Issue
Block a user