From 9faba833a2db3fbb645e84d865470222a40165f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 1 May 2000 13:08:56 +0000 Subject: [PATCH] fixed memory leak in modules list (devik's patch) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/html/winpars.h | 1 + src/html/winpars.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/wx/html/winpars.h b/include/wx/html/winpars.h index 2c90277586..1d96d69de5 100644 --- a/include/wx/html/winpars.h +++ b/include/wx/html/winpars.h @@ -66,6 +66,7 @@ class WXDLLEXPORT wxHtmlWinParser : public wxHtmlParser static void AddModule(wxHtmlTagsModule *module); // Adds tags module. see wxHtmlTagsModule for details. + static void RemoveModule(wxHtmlTagsModule *module); // parsing-related methods. These methods are called by tag handlers: wxHtmlContainerCell *GetContainer() const {return m_Container;} diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 24748b018a..ca7afc5fd5 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -103,6 +103,13 @@ void wxHtmlWinParser::AddModule(wxHtmlTagsModule *module) +void wxHtmlWinParser::RemoveModule(wxHtmlTagsModule *module) +{ + m_Modules.DeleteObject(module); +} + + + void wxHtmlWinParser::SetFonts(wxString normal_face, wxString fixed_face, const int *sizes) { int i, j, k, l, m; @@ -392,6 +399,7 @@ bool wxHtmlTagsModule::OnInit() void wxHtmlTagsModule::OnExit() { + wxHtmlWinParser::RemoveModule(this); } #endif