I got tired of some of the memory leak messages related to html and

filesystem classes, (even when I wasn't using them) so I added to the
cleanup code already there.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-09-20 20:15:31 +00:00
parent d57eb7b9b3
commit 269e82009d
3 changed files with 39 additions and 26 deletions

View File

@@ -175,6 +175,9 @@ class WXDLLEXPORT wxFileSystem : public wxObject
static void AddHandler(wxFileSystemHandler *handler); static void AddHandler(wxFileSystemHandler *handler);
// Adds FS handler. // Adds FS handler.
// In fact, this class is only front-end to the FS hanlers :-) // In fact, this class is only front-end to the FS hanlers :-)
static void CleanUpHandlers();
// remove all items from the m_Handlers list
}; };

View File

@@ -309,6 +309,12 @@ void wxFileSystem::AddHandler(wxFileSystemHandler *handler)
} }
void wxFileSystem::CleanUpHandlers()
{
m_Handlers.DeleteContents(TRUE);
m_Handlers.Clear();
}
///// Module: ///// Module:
@@ -325,6 +331,7 @@ class wxFileSystemModule : public wxModule
virtual void OnExit() virtual void OnExit()
{ {
wxFileSystemHandler::CleanUpStatics(); wxFileSystemHandler::CleanUpStatics();
wxFileSystem::CleanUpHandlers();
} }
}; };

View File

@@ -389,13 +389,16 @@ void wxHtmlWindow::CleanUpStatics()
{ {
if (m_DefaultFilter) delete m_DefaultFilter; if (m_DefaultFilter) delete m_DefaultFilter;
m_DefaultFilter = NULL; m_DefaultFilter = NULL;
wxNode* node = m_Filters.GetFirst();
m_Filters.DeleteContents(TRUE);
m_Filters.Clear();
} }
void wxHtmlWindow::AddFilter(wxHtmlFilter *filter) void wxHtmlWindow::AddFilter(wxHtmlFilter *filter)
{ {
m_Filters.DeleteContents(TRUE);
m_Filters.Append(filter); m_Filters.Append(filter);
} }