X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1c8c2f806ac71bc0af377964d4cadc64218c226..236a9de39afa090fdee3cf91cb5364ceca69e3f8:/src/common/mimecmn.cpp diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index b3aaa70eaf..25a0eedb28 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -15,6 +15,7 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/module.h" #ifdef __BORLANDC__ #pragma hdrstop @@ -217,6 +218,11 @@ bool wxFileType::GetMimeType(wxString *mimeType) const return m_impl->GetMimeType(mimeType); } +bool wxFileType::GetMimeTypes(wxArrayString& mimeTypes) const +{ + return m_impl->GetMimeTypes(mimeTypes); +} + bool wxFileType::GetIcon(wxIcon *icon) const { return m_impl->GetIcon(icon); @@ -336,6 +342,29 @@ static wxMimeTypesManager gs_mimeTypesManager; wxMimeTypesManager * wxTheMimeTypesManager = &gs_mimeTypesManager; + + + +class wxMimeTypeCmnModule: public wxModule +{ +DECLARE_DYNAMIC_CLASS(wxMimeTypeCmnModule) +public: + wxMimeTypeCmnModule() : wxModule() {} + bool OnInit() { return TRUE; } + void OnExit() + { // this avoids false memory leak allerts: + if (gs_mimeTypesManager.m_impl != NULL) + { + delete gs_mimeTypesManager.m_impl; + gs_mimeTypesManager.m_impl = NULL; + } + } +}; + +IMPLEMENT_DYNAMIC_CLASS(wxMimeTypeCmnModule, wxModule) + + + #endif // wxUSE_FILE && wxUSE_TEXTFILE