Don't leave wxHtmlWinParser with a dangling wxDC pointer.

Call SetDC(NULL) to prevent wxHtmlWinParser from using a pointer to the
already destroyed wxDC object.

See #16501.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-08-29 11:56:33 +00:00
parent 88e808c9ac
commit 0f60be60a2

View File

@@ -495,6 +495,10 @@ bool wxHtmlWindow::DoSetPage(const wxString& source)
m_Cell = (wxHtmlContainerCell*) m_Parser->Parse(newsrc); m_Cell = (wxHtmlContainerCell*) m_Parser->Parse(newsrc);
// The parser doesn't need the DC any more, so ensure it's not left with a
// dangling pointer after the DC object goes out of scope.
m_Parser->SetDC(NULL);
m_Cell->SetIndent(m_Borders, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS); m_Cell->SetIndent(m_Borders, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS);
m_Cell->SetAlignHor(wxHTML_ALIGN_CENTER); m_Cell->SetAlignHor(wxHTML_ALIGN_CENTER);
CreateLayout(); CreateLayout();