fixed static members

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3131 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
1999-07-25 12:21:23 +00:00
parent 420ec58abb
commit a76015e6eb
4 changed files with 58 additions and 8 deletions

View File

@@ -35,7 +35,13 @@
IMPLEMENT_ABSTRACT_CLASS(wxFileSystemHandler, wxObject)
wxMimeTypesManager wxFileSystemHandler::m_MimeMng;
wxMimeTypesManager *wxFileSystemHandler::m_MimeMng = NULL;
void wxFileSystemHandler::CleanUpStatics()
{
if (m_MimeMng) delete m_MimeMng;
m_MimeMng = NULL;
}
wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location)
@@ -53,7 +59,8 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location)
if (c == _T('.')) {ext = loc.Right(l2-i-1); break;}
if ((c == _T('/')) || (c == _T('\\')) || (c == _T(':'))) {return wxEmptyString;}
}
ft = m_MimeMng.GetFileTypeFromExtension(ext);
if (m_MimeMng == NULL) m_MimeMng = new wxMimeTypesManager;
ft = m_MimeMng -> GetFileTypeFromExtension(ext);
if (ft && (ft -> GetMimeType(&mime))) return mime;
else return wxEmptyString;
}
@@ -279,7 +286,10 @@ class wxFileSystemModule : public wxModule
wxFileSystem::AddHandler(new wxLocalFSHandler);
return TRUE;
}
virtual void OnExit() {}
virtual void OnExit()
{
wxFileSystemHandler::CleanUpStatics();
}
};
IMPLEMENT_DYNAMIC_CLASS(wxFileSystemModule, wxModule)
@@ -287,3 +297,5 @@ IMPLEMENT_DYNAMIC_CLASS(wxFileSystemModule, wxModule)
#endif
// (wxUSE_FS_INET || wxUSE_FS_ZIP) && wxUSE_STREAMS